Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
53affa1a
Commit
53affa1a
authored
Oct 12, 2002
by
Alan Cox
Committed by
Linus Torvalds
Oct 12, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[PATCH] mpt fusion update from vendor
parent
75a97cd1
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
274 additions
and
107 deletions
+274
-107
drivers/message/fusion/Config.help
drivers/message/fusion/Config.help
+10
-0
drivers/message/fusion/Config.in
drivers/message/fusion/Config.in
+1
-0
drivers/message/fusion/linux_compat.h
drivers/message/fusion/linux_compat.h
+20
-9
drivers/message/fusion/lsi/mpi.h
drivers/message/fusion/lsi/mpi.h
+3
-2
drivers/message/fusion/lsi/mpi_cnfg.h
drivers/message/fusion/lsi/mpi_cnfg.h
+3
-1
drivers/message/fusion/lsi/mpi_targ.h
drivers/message/fusion/lsi/mpi_targ.h
+6
-1
drivers/message/fusion/mptbase.c
drivers/message/fusion/mptbase.c
+21
-1
drivers/message/fusion/mptbase.h
drivers/message/fusion/mptbase.h
+10
-4
drivers/message/fusion/mptctl.c
drivers/message/fusion/mptctl.c
+5
-5
drivers/message/fusion/mptctl.h
drivers/message/fusion/mptctl.h
+5
-5
drivers/message/fusion/mptlan.c
drivers/message/fusion/mptlan.c
+16
-3
drivers/message/fusion/mptlan.h
drivers/message/fusion/mptlan.h
+4
-0
drivers/message/fusion/mptscsih.c
drivers/message/fusion/mptscsih.c
+137
-73
drivers/message/fusion/mptscsih.h
drivers/message/fusion/mptscsih.h
+33
-3
No files found.
drivers/message/fusion/Config.help
View file @
53affa1a
...
...
@@ -42,6 +42,16 @@ CONFIG_FUSION
architecture is based on LSI Logic's Message Passing Interface (MPI)
specification.
Maximum number of scatter gather entries
CONFIG_FUSION_MAX_SGE
This option allows you to specify the maximum number of scatter-
gather entries per I/O. The driver defaults to 40, a reasonable number
for most systems. However, the user may increase this up to 128.
Increasing this parameter will require significantly more memory
on a per controller instance. Increasing the parameter is not
necessary (or recommended) unless the user will be running
large I/O's via the raw interface.
CONFIG_FUSION_ISENSE
The isense module (roughly stands for Interpret SENSE data) is
completely optional. It simply provides extra English readable
...
...
drivers/message/fusion/Config.in
View file @
53affa1a
...
...
@@ -10,6 +10,7 @@ if [ "$CONFIG_FUSION" = "y" -o "$CONFIG_FUSION" = "m" ]; then
else
define_bool CONFIG_FUSION_BOOT n
fi
int " Maximum number of scatter gather entries" CONFIG_FUSION_MAX_SGE 40
if [ "$CONFIG_MODULES" = "y" ]; then
# How can we force these options to module or nothing?
...
...
drivers/message/fusion/linux_compat.h
View file @
53affa1a
...
...
@@ -253,25 +253,36 @@ static __inline__ int __get_order(unsigned long size)
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
#define mptscsih_save_flags(flags) \
({ local_irq_save(flags); \
})
#define mptscsih_lock(iocp, flags) \
spin_lock_irqsave(&iocp->FreeQlock, flags)
#else
#define mptscsih_
save_flags(
flags) \
#define mptscsih_
lock(iocp,
flags) \
({ save_flags(flags); \
cli(); \
})
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,28)
#define mptscsih_restore_flags(flags) \
({ local_irq_enable(); \
local_irq_restore(flags); \
})
#define mptscsih_unlock(iocp, flags) \
spin_unlock_irqrestore(&iocp->FreeQlock, flags)
#else
#define mptscsih_unlock(iocp, flags) restore_flags(flags);
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,41)
#define mpt_work_struct work_struct
#define MPT_INIT_WORK(_task, _func, _data) INIT_WORK(_task, _func, _data)
#else
#define mptscsih_restore_flags(flags) restore_flags(flags);
#define mpt_work_struct tq_struct
#define MPT_INIT_WORK(_task, _func, _data) \
({ (_task)->sync = 0; \
(_task)->routine = (_func); \
(_task)->data = (void *) (_data); \
})
#endif
/*}-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#endif
/* _LINUX_COMPAT_H */
drivers/message/fusion/lsi/mpi.h
View file @
53affa1a
...
...
@@ -6,7 +6,7 @@
* Title: MPI Message independent structures and definitions
* Creation Date: July 27, 2000
*
* MPI.H Version: 01.02.0
6
* MPI.H Version: 01.02.0
7
*
* Version History
* ---------------
...
...
@@ -47,6 +47,7 @@
* 03-14-02 01.02.04 Added MPI_HEADER_VERSION_ defines.
* 05-31-02 01.02.05 Bumped MPI_HEADER_VERSION_UNIT.
* 07-12-02 01.02.06 Added define for MPI_FUNCTION_MAILBOX.
* 09-16-02 01.02.07 Bumped value for MPI_HEADER_VERSION_UNIT.
* --------------------------------------------------------------------------
*/
...
...
@@ -75,7 +76,7 @@
/* Note: The major versions of 0xe0 through 0xff are reserved */
/* versioning for this MPI header set */
#define MPI_HEADER_VERSION_UNIT (0x0
7
)
#define MPI_HEADER_VERSION_UNIT (0x0
9
)
#define MPI_HEADER_VERSION_DEV (0x00)
#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
...
...
drivers/message/fusion/lsi/mpi_cnfg.h
View file @
53affa1a
...
...
@@ -6,7 +6,7 @@
* Title: MPI Config message, structures, and Pages
* Creation Date: July 27, 2000
*
* MPI_CNFG.H Version: 01.02.0
8
* MPI_CNFG.H Version: 01.02.0
9
*
* Version History
* ---------------
...
...
@@ -127,6 +127,7 @@
* MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE.
* Added new config page: CONFIG_PAGE_SCSI_DEVICE_3.
* Modified MPI_FCPORTPAGE5_FLAGS_ defines.
* 09-16-02 01.02.09 Added more MPI_SCSIDEVPAGE1_CONF_FORCE_PPR_MSG define.
* --------------------------------------------------------------------------
*/
...
...
@@ -814,6 +815,7 @@ typedef struct _CONFIG_PAGE_SCSI_DEVICE_1
#define MPI_SCSIDEVPAGE1_CONF_WDTR_DISALLOWED (0x00000002)
#define MPI_SCSIDEVPAGE1_CONF_SDTR_DISALLOWED (0x00000004)
#define MPI_SCSIDEVPAGE1_CONF_EXTENDED_PARAMS_ENABLE (0x00000008)
#define MPI_SCSIDEVPAGE1_CONF_FORCE_PPR_MSG (0x00000010)
typedef
struct
_CONFIG_PAGE_SCSI_DEVICE_2
...
...
drivers/message/fusion/lsi/mpi_targ.h
View file @
53affa1a
...
...
@@ -6,7 +6,7 @@
* Title: MPI Target mode messages and structures
* Creation Date: June 22, 2000
*
* MPI_TARG.H Version: 01.02.0
6
* MPI_TARG.H Version: 01.02.0
7
*
* Version History
* ---------------
...
...
@@ -39,6 +39,8 @@
* 05-31-02 01.02.06 Modified TARGET_MODE_REPLY_ALIAS_MASK to only include
* one bit.
* Added AliasIndex field to MPI_TARGET_FCP_CMD_BUFFER.
* 09-16-02 01.02.07 Added flags for confirmed completion.
* Added PRIORITY_REASON_TARGET_BUSY.
* --------------------------------------------------------------------------
*/
...
...
@@ -138,6 +140,7 @@ typedef struct _MSG_PRIORITY_CMD_RECEIVED_REPLY
#define PRIORITY_REASON_PROTOCOL_ERR (0x06)
#define PRIORITY_REASON_DATA_OUT_PARITY_ERR (0x07)
#define PRIORITY_REASON_DATA_OUT_CRC_ERR (0x08)
#define PRIORITY_REASON_TARGET_BUSY (0x09)
#define PRIORITY_REASON_UNKNOWN (0xFF)
...
...
@@ -217,6 +220,7 @@ typedef struct _MSG_TARGET_ASSIST_REQUEST
#define TARGET_ASSIST_FLAGS_DATA_DIRECTION (0x01)
#define TARGET_ASSIST_FLAGS_AUTO_STATUS (0x02)
#define TARGET_ASSIST_FLAGS_HIGH_PRIORITY (0x04)
#define TARGET_ASSIST_FLAGS_CONFIRMED (0x08)
#define TARGET_ASSIST_FLAGS_REPOST_CMD_BUFFER (0x80)
...
...
@@ -261,6 +265,7 @@ typedef struct _MSG_TARGET_STATUS_SEND_REQUEST
#define TARGET_STATUS_SEND_FLAGS_AUTO_GOOD_STATUS (0x01)
#define TARGET_STATUS_SEND_FLAGS_HIGH_PRIORITY (0x04)
#define TARGET_STATUS_SEND_FLAGS_CONFIRMED (0x08)
#define TARGET_STATUS_SEND_FLAGS_REPOST_CMD_BUFFER (0x80)
/*
...
...
drivers/message/fusion/mptbase.c
View file @
53affa1a
...
...
@@ -49,7 +49,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptbase.c,v 1.12
1 2002/07/23 18:56:59
pdelaney Exp $
* $Id: mptbase.c,v 1.12
2 2002/10/03 13:10:11
pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
...
...
@@ -1416,10 +1416,30 @@ mpt_adapter_install(struct pci_dev *pdev)
else
if
(
pdev
->
device
==
MPI_MANUFACTPAGE_DEVICEID_FC929X
)
{
ioc
->
chip_type
=
FC929X
;
ioc
->
prod_name
=
"LSIFC929X"
;
{
/* 929X Chip Fix. Set Split transactions level
* for PCIX. Set bits 5 - 6 to zero, turn on bit 4.
*/
u16
pcixcmd
=
0
;
pci_read_config_word
(
pdev
,
0x6a
,
&
pcixcmd
);
pcixcmd
&=
0xFF9F
;
pcixcmd
|=
0x0010
;
pci_write_config_word
(
pdev
,
0x6a
,
pcixcmd
);
}
}
else
if
(
pdev
->
device
==
MPI_MANUFACTPAGE_DEVICEID_FC919X
)
{
ioc
->
chip_type
=
FC919X
;
ioc
->
prod_name
=
"LSIFC919X"
;
{
/* 919X Chip Fix. Set Split transactions level
* for PCIX. Set bits 5 - 6 to zero, turn on bit 4.
*/
u16
pcixcmd
=
0
;
pci_read_config_word
(
pdev
,
0x6a
,
&
pcixcmd
);
pcixcmd
&=
0xFF9F
;
pcixcmd
|=
0x0010
;
pci_write_config_word
(
pdev
,
0x6a
,
pcixcmd
);
}
}
else
if
(
pdev
->
device
==
MPI_MANUFACTPAGE_DEVID_53C1030
)
{
ioc
->
chip_type
=
C1030
;
...
...
drivers/message/fusion/mptbase.h
View file @
53affa1a
...
...
@@ -13,7 +13,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptbase.h,v 1.13
3 2002/09/05 22:30:09
pdelaney Exp $
* $Id: mptbase.h,v 1.13
4 2002/10/03 13:10:12
pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
...
...
@@ -80,8 +80,8 @@
#define COPYRIGHT "Copyright (c) 1999-2002 " MODULEAUTHOR
#endif
#define MPT_LINUX_VERSION_COMMON "2.02.01.0
1
"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.02.01.0
1
"
#define MPT_LINUX_VERSION_COMMON "2.02.01.0
7
"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.02.01.0
7
"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
...
...
@@ -91,7 +91,7 @@
/*
* Fusion MPT(linux) driver configurable stuff...
*/
#define MPT_MAX_ADAPTERS 1
6
#define MPT_MAX_ADAPTERS 1
8
#define MPT_MAX_PROTOCOL_DRIVERS 16
#define MPT_MAX_BUS 1
#define MPT_MAX_FC_DEVICES 255
...
...
@@ -397,8 +397,10 @@ typedef struct _VirtDevice {
ScsiCmndTracker
SentQ
;
ScsiCmndTracker
DoneQ
;
//--- LUN split here?
#ifdef MPT_SAVE_AUTOSENSE
u8
sense
[
SCSI_STD_SENSE_BYTES
];
/* 18 */
u8
rsvd2
[
2
];
/* alignment */
#endif
u32
luns
;
/* Max LUNs is 32 */
u8
inq_data
[
SCSI_STD_INQUIRY_BYTES
];
/* 36 */
u8
pad0
[
4
];
...
...
@@ -424,7 +426,9 @@ typedef struct _VirtDevice {
#define MPT_TARGET_DEFAULT_DV_STATUS 0
#define MPT_TARGET_FLAGS_VALID_NEGO 0x01
#define MPT_TARGET_FLAGS_VALID_INQUIRY 0x02
#ifdef MPT_SAVE_AUTOSENSE
#define MPT_TARGET_FLAGS_VALID_SENSE 0x04
#endif
#define MPT_TARGET_FLAGS_Q_YES 0x08
#define MPT_TARGET_FLAGS_VALID_56 0x10
...
...
@@ -890,6 +894,8 @@ typedef struct _MPT_SCSI_HOST {
MPT_Q_TRACKER
taskQ
;
/* TM request Q */
spinlock_t
freedoneQlock
;
int
taskQcnt
;
int
num_chain
;
/* Number of chain buffers */
int
max_sge
;
/* Max No of SGE*/
u8
numTMrequests
;
u8
tmPending
;
u8
resetPending
;
...
...
drivers/message/fusion/mptctl.c
View file @
53affa1a
...
...
@@ -34,7 +34,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptctl.c,v 1.
59 2002/09/05 22:30:10
pdelaney Exp $
* $Id: mptctl.c,v 1.
60 2002/10/03 13:10:13
pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
...
...
@@ -627,7 +627,7 @@ mptctl_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned
/* Test for Compaq-specific IOCTL's.
*/
if
((
cmd
==
CPQFCTS_GETPCIINFO
)
||
(
cmd
==
CPQFCTS_CTLR_STATUS
)
||
(
cmd
==
CPQFCTS_GETDRIVER
)
||
(
cmd
==
CPQFCTS_SCSI_PASSTHRU
)
||
(
cmd
==
CPQFCTS_GETDRIV
V
ER
)
||
(
cmd
==
CPQFCTS_SCSI_PASSTHRU
)
||
(
cmd
==
CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS
))
return
mptctl_compaq_ioctl
(
file
,
cmd
,
arg
);
...
...
@@ -2406,7 +2406,7 @@ mptctl_compaq_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
case
CPQFCTS_GETPCIINFO
:
ret
=
mptctl_cpq_getpciinfo
(
arg
);
break
;
case
CPQFCTS_GETDRIVER
:
case
CPQFCTS_GETDRIV
V
ER
:
ret
=
mptctl_cpq_getdriver
(
arg
);
break
;
case
CPQFCTS_CTLR_STATUS
:
...
...
@@ -3180,7 +3180,7 @@ int __init mptctl_init(void)
if
(
++
where
&&
err
)
goto
out_fail
;
err
=
register_ioctl32_conversion
(
CPQFCTS_CTLR_STATUS
,
NULL
);
if
(
++
where
&&
err
)
goto
out_fail
;
err
=
register_ioctl32_conversion
(
CPQFCTS_GETDRIVER
,
NULL
);
err
=
register_ioctl32_conversion
(
CPQFCTS_GETDRIV
V
ER
,
NULL
);
if
(
++
where
&&
err
)
goto
out_fail
;
err
=
register_ioctl32_conversion
(
CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS
,
NULL
);
if
(
++
where
&&
err
)
goto
out_fail
;
...
...
@@ -3234,7 +3234,7 @@ int __init mptctl_init(void)
unregister_ioctl32_conversion
(
MPTCOMMAND32
);
unregister_ioctl32_conversion
(
MPTFWDOWNLOAD32
);
unregister_ioctl32_conversion
(
CPQFCTS_GETPCIINFO
);
unregister_ioctl32_conversion
(
CPQFCTS_GETDRIVER
);
unregister_ioctl32_conversion
(
CPQFCTS_GETDRIV
V
ER
);
unregister_ioctl32_conversion
(
CPQFCTS_CTLR_STATUS
);
unregister_ioctl32_conversion
(
CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS
);
unregister_ioctl32_conversion
(
CPQFCTS_SCSI_PASSTHRU32
);
...
...
drivers/message/fusion/mptctl.h
View file @
53affa1a
...
...
@@ -20,7 +20,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptctl.h,v 1.1
0 2002/05/28 15:57:16
pdelaney Exp $
* $Id: mptctl.h,v 1.1
1 2002/10/03 13:10:13
pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
...
...
@@ -319,12 +319,12 @@ struct mpt_ioctl_command32 {
#define CPQFCTS_IOC_MAGIC 'Z'
#define CPQFCTS_GETPCIINFO _IOR(CPQFCTS_IOC_MAGIC, 1, cpqfc_pci_info_struct)
#define CPQFCTS_GETDRIV
ER _IOR(CPQFCTS_IOC_MAGIC, 2
, int)
#define CPQFCTS_GETDRIV
VER _IOR(CPQFCTS_IOC_MAGIC, 9
, int)
#define CPQFCTS_CTLR_STATUS _IOR(CPQFCTS_IOC_MAGIC, 3, struct _cpqfc_ctlr_status)
#define CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS _IOR(CPQFCTS_IOC_MAGIC,
4
, struct scsi_fctargaddress)
#define CPQFCTS_SCSI_PASSTHRU _IOWR(CPQFCTS_IOC_MAGIC,
5
, VENDOR_IOCTL_REQ)
#define CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS _IOR(CPQFCTS_IOC_MAGIC,
13
, struct scsi_fctargaddress)
#define CPQFCTS_SCSI_PASSTHRU _IOWR(CPQFCTS_IOC_MAGIC,
11
, VENDOR_IOCTL_REQ)
#if defined(__sparc__) && defined(__sparc_v9__)
#define CPQFCTS_SCSI_PASSTHRU32 _IOWR(CPQFCTS_IOC_MAGIC,
5
, VENDOR_IOCTL_REQ32)
#define CPQFCTS_SCSI_PASSTHRU32 _IOWR(CPQFCTS_IOC_MAGIC,
11
, VENDOR_IOCTL_REQ32)
#endif
typedef
struct
{
...
...
drivers/message/fusion/mptlan.c
View file @
53affa1a
...
...
@@ -132,7 +132,7 @@ struct mpt_lan_priv {
u32
total_received
;
struct
net_device_stats
stats
;
/* Per device statistics */
struct
work_struct
post_buckets_task
;
struct
mpt_
work_struct
post_buckets_task
;
unsigned
long
post_buckets_active
;
};
...
...
@@ -876,9 +876,22 @@ mpt_lan_wake_post_buckets_task(struct net_device *dev, int priority)
if
(
test_and_set_bit
(
0
,
&
priv
->
post_buckets_active
)
==
0
)
{
if
(
priority
)
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,41)
schedule_work
(
&
priv
->
post_buckets_task
);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,40)
schedule_task
(
&
priv
->
post_buckets_task
);
#else
queue_task
(
&
priv
->
post_buckets_task
,
&
tq_immediate
);
mark_bh
(
IMMEDIATE_BH
);
#endif
}
else
{
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,41)
schedule_delayed_work
(
&
priv
->
post_buckets_task
,
1
);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,40)
schedule_task
(
&
priv
->
post_buckets_task
);
#else
queue_task
(
&
priv
->
post_buckets_task
,
&
tq_timer
);
#endif
dioprintk
((
KERN_INFO
MYNAM
": post_buckets queued on "
"timer.
\n
"
));
}
...
...
@@ -1364,8 +1377,8 @@ mpt_register_lan_device (MPT_ADAPTER *mpt_dev, int pnum)
priv
->
mpt_dev
=
mpt_dev
;
priv
->
pnum
=
pnum
;
memset
(
&
priv
->
post_buckets_task
,
0
,
sizeof
(
struct
work_struct
));
INIT_WORK
(
&
priv
->
post_buckets_task
,
mpt_lan_post_receive_buckets
,
dev
);
memset
(
&
priv
->
post_buckets_task
,
0
,
sizeof
(
struct
mpt_
work_struct
));
MPT_
INIT_WORK
(
&
priv
->
post_buckets_task
,
mpt_lan_post_receive_buckets
,
dev
);
priv
->
post_buckets_active
=
0
;
dlprintk
((
KERN_INFO
MYNAM
"@%d: bucketlen = %d
\n
"
,
...
...
drivers/message/fusion/mptlan.h
View file @
53affa1a
...
...
@@ -20,7 +20,11 @@
#include <linux/slab.h>
#include <linux/miscdevice.h>
#include <linux/spinlock.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,41)
#include <linux/tqueue.h>
#else
#include <linux/workqueue.h>
#endif
#include <linux/delay.h>
// #include <linux/trdevice.h>
...
...
drivers/message/fusion/mptscsih.c
View file @
53affa1a
...
...
@@ -26,7 +26,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptscsih.c,v 1.10
1 2002/09/05 22:30:11
pdelaney Exp $
* $Id: mptscsih.c,v 1.10
2 2002/10/03 13:10:14
pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
...
...
@@ -76,7 +76,6 @@
#include <linux/delay.h>
/* for mdelay */
#include <linux/interrupt.h>
/* needed for in_interrupt() proto */
#include <linux/reboot.h>
/* notifier code */
#include <linux/workqueue.h>
#include "../../scsi/scsi.h"
#include "../../scsi/hosts.h"
#include "../../scsi/sd.h"
...
...
@@ -165,7 +164,6 @@ static int mptscsih_AddSGE(MPT_SCSI_HOST *hd, Scsi_Cmnd *SCpnt,
static
int
mptscsih_getFreeChainBuffer
(
MPT_SCSI_HOST
*
hd
,
int
*
retIndex
);
static
void
mptscsih_freeChainBuffers
(
MPT_SCSI_HOST
*
hd
,
int
req_idx
);
static
int
mptscsih_initChainBuffers
(
MPT_SCSI_HOST
*
hd
,
int
init
);
static
void
copy_sense_data
(
Scsi_Cmnd
*
sc
,
MPT_SCSI_HOST
*
hd
,
MPT_FRAME_HDR
*
mf
,
SCSIIOReply_t
*
pScsiReply
);
#ifndef MPT_SCSI_USE_NEW_EH
static
void
search_taskQ_for_cmd
(
Scsi_Cmnd
*
sc
,
MPT_SCSI_HOST
*
hd
);
...
...
@@ -184,7 +182,9 @@ static int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pE
static
VirtDevice
*
mptscsih_initTarget
(
MPT_SCSI_HOST
*
hd
,
int
bus_id
,
int
target_id
,
u8
lun
,
char
*
data
,
int
dlen
);
void
mptscsih_setTargetNegoParms
(
MPT_SCSI_HOST
*
hd
,
VirtDevice
*
target
,
char
byte56
);
#ifdef MPT_SAVE_AUTOSENSE
static
void
clear_sense_flag
(
MPT_SCSI_HOST
*
hd
,
SCSIIORequest_t
*
pReq
);
#endif
static
void
mptscsih_set_dvflags
(
MPT_SCSI_HOST
*
hd
,
SCSIIORequest_t
*
pReq
);
static
void
mptscsih_setDevicePage1Flags
(
u8
width
,
u8
factor
,
u8
offset
,
int
*
requestedPtr
,
int
*
configurationPtr
,
u8
flags
);
static
void
mptscsih_no_negotiate
(
MPT_SCSI_HOST
*
hd
,
int
target_id
);
...
...
@@ -245,7 +245,7 @@ static struct proc_dir_entry proc_mpt_scsihost =
*/
static
spinlock_t
mytaskQ_lock
=
SPIN_LOCK_UNLOCKED
;
static
int
mytaskQ_bh_active
=
0
;
static
struct
work_struct
mptscsih_ptaskfoo
;
static
struct
mpt_
work_struct
mptscsih_ptaskfoo
;
static
atomic_t
mpt_taskQdepth
;
#endif
...
...
@@ -256,7 +256,7 @@ static atomic_t mpt_taskQdepth;
static
spinlock_t
dvtaskQ_lock
=
SPIN_LOCK_UNLOCKED
;
static
int
dvtaskQ_active
=
0
;
static
int
dvtaskQ_release
=
0
;
static
struct
work_struct
mptscsih_dvTask
;
static
struct
mpt_
work_struct
mptscsih_dvTask
;
#endif
/*
...
...
@@ -352,7 +352,9 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
dlen
);
}
}
#ifdef MPT_SAVE_AUTOSENSE
clear_sense_flag
(
hd
,
pScsiReq
);
#endif
}
else
{
u32
xfer_cnt
;
u16
status
;
...
...
@@ -437,17 +439,21 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
* precedence!
*/
sc
->
result
=
(
DID_OK
<<
16
)
|
pScsiReply
->
SCSIStatus
;
#ifdef MPT_SAVE_AUTOSENSE
clear_sense_flag
(
hd
,
pScsiReq
);
if
(
pScsiReply
->
SCSIState
&
MPI_SCSI_STATE_AUTOSENSE_VALID
)
{
#endif
if
(
scsi_state
==
0
)
{
;
}
else
if
(
scsi_state
&
MPI_SCSI_STATE_AUTOSENSE_VALID
)
{
/* Have already saved the status and sense data
*/
;
}
else
if
(
pScsiReply
->
SCSIS
tate
&
(
MPI_SCSI_STATE_AUTOSENSE_FAILED
|
MPI_SCSI_STATE_NO_SCSI_STATUS
))
{
}
else
if
(
scsi_s
tate
&
(
MPI_SCSI_STATE_AUTOSENSE_FAILED
|
MPI_SCSI_STATE_NO_SCSI_STATUS
))
{
/* What to do?
*/
sc
->
result
=
DID_SOFT_ERROR
<<
16
;
}
else
if
(
pScsiReply
->
SCSIS
tate
&
MPI_SCSI_STATE_TERMINATED
)
{
else
if
(
scsi_s
tate
&
MPI_SCSI_STATE_TERMINATED
)
{
/* Not real sure here either... */
sc
->
result
=
DID_RESET
<<
16
;
}
...
...
@@ -488,9 +494,12 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
case
MPI_IOCSTATUS_SCSI_RECOVERED_ERROR
:
/* 0x0040 */
case
MPI_IOCSTATUS_SUCCESS
:
/* 0x0000 */
sc
->
result
=
(
DID_OK
<<
16
)
|
pScsiReply
->
SCSIStatus
;
#ifdef MPT_SAVE_AUTOSENSE
clear_sense_flag
(
hd
,
pScsiReq
);
if
(
pScsiReply
->
SCSIState
&
MPI_SCSI_STATE_AUTOSENSE_VALID
)
{
#endif
if
(
scsi_state
==
0
)
{
;
}
else
if
(
scsi_state
&
MPI_SCSI_STATE_AUTOSENSE_VALID
)
{
/*
* If running agains circa 200003dd 909 MPT f/w,
* may get this (AUTOSENSE_VALID) for actual TASK_SET_FULL
...
...
@@ -521,7 +530,7 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
#endif
}
else
if
(
pScsiReply
->
SCSIS
tate
&
else
if
(
scsi_s
tate
&
(
MPI_SCSI_STATE_AUTOSENSE_FAILED
|
MPI_SCSI_STATE_NO_SCSI_STATUS
)
)
{
/*
...
...
@@ -529,11 +538,11 @@ mptscsih_io_done(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
*/
sc
->
result
=
DID_SOFT_ERROR
<<
16
;
}
else
if
(
pScsiReply
->
SCSIS
tate
&
MPI_SCSI_STATE_TERMINATED
)
{
else
if
(
scsi_s
tate
&
MPI_SCSI_STATE_TERMINATED
)
{
/* Not real sure here either... */
sc
->
result
=
DID_RESET
<<
16
;
}
else
if
(
pScsiReply
->
SCSIS
tate
&
MPI_SCSI_STATE_QUEUE_TAG_REJECTED
)
{
else
if
(
scsi_s
tate
&
MPI_SCSI_STATE_QUEUE_TAG_REJECTED
)
{
/* Device Inq. data indicates that it supports
* QTags, but rejects QTag messages.
* This command completed OK.
...
...
@@ -1024,21 +1033,13 @@ mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init)
MPT_FRAME_HDR
*
chain
;
u8
*
mem
;
unsigned
long
flags
;
int
sz
,
ii
,
numChain
;
int
sz
,
ii
,
num_chain
;
int
scale
,
num_sge
;
/* Chain buffer allocations
* Allocate and initialize tracker structures
/* ReqToChain size must equal the req_depth
* index = req_idx
*/
if
(
hd
->
ioc
->
req_sz
<=
64
)
numChain
=
MPT_SG_REQ_64_SCALE
*
hd
->
ioc
->
req_depth
;
else
if
(
hd
->
ioc
->
req_sz
<=
96
)
numChain
=
MPT_SG_REQ_96_SCALE
*
hd
->
ioc
->
req_depth
;
else
numChain
=
MPT_SG_REQ_128_SCALE
*
hd
->
ioc
->
req_depth
;
sz
=
numChain
*
sizeof
(
int
);
sz
=
hd
->
ioc
->
req_depth
*
sizeof
(
int
);
if
(
hd
->
ReqToChain
==
NULL
)
{
mem
=
kmalloc
(
sz
,
GFP_ATOMIC
);
if
(
mem
==
NULL
)
...
...
@@ -1050,6 +1051,38 @@ mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init)
}
memset
(
mem
,
0xFF
,
sz
);
/* ChainToChain size must equal the total number
* of chain buffers to be allocated.
* index = chain_idx
*
* Calculate the number of chain buffers needed(plus 1) per I/O
* then multiply the the maximum number of simultaneous cmds
*
* num_sge = num sge in request frame + last chain buffer
* scale = num sge per chain buffer if no chain element
*/
scale
=
hd
->
ioc
->
req_sz
/
(
sizeof
(
dma_addr_t
)
+
sizeof
(
u32
));
if
(
sizeof
(
dma_addr_t
)
==
sizeof
(
u64
))
num_sge
=
scale
+
(
hd
->
ioc
->
req_sz
-
60
)
/
(
sizeof
(
dma_addr_t
)
+
sizeof
(
u32
));
else
num_sge
=
1
+
scale
+
(
hd
->
ioc
->
req_sz
-
64
)
/
(
sizeof
(
dma_addr_t
)
+
sizeof
(
u32
));
num_chain
=
1
;
while
(
hd
->
max_sge
-
num_sge
>
0
)
{
num_chain
++
;
num_sge
+=
(
scale
-
1
);
}
num_chain
++
;
if
((
int
)
hd
->
ioc
->
chip_type
>
(
int
)
FC929
)
num_chain
*=
MPT_SCSI_CAN_QUEUE
;
else
num_chain
*=
MPT_FC_CAN_QUEUE
;
hd
->
num_chain
=
num_chain
;
sz
=
num_chain
*
sizeof
(
int
);
if
(
hd
->
ChainToChain
==
NULL
)
{
mem
=
kmalloc
(
sz
,
GFP_ATOMIC
);
if
(
mem
==
NULL
)
...
...
@@ -1061,10 +1094,10 @@ mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init)
}
memset
(
mem
,
0xFF
,
sz
);
sz
=
num_chain
*
hd
->
ioc
->
req_sz
;
if
(
hd
->
ChainBuffer
==
NULL
)
{
/* Allocate free chain buffer pool
*/
sz
=
numChain
*
hd
->
ioc
->
req_sz
;
mem
=
pci_alloc_consistent
(
hd
->
ioc
->
pcidev
,
sz
,
&
hd
->
ChainBufferDMA
);
if
(
mem
==
NULL
)
return
-
1
;
...
...
@@ -1090,7 +1123,7 @@ mptscsih_initChainBuffers (MPT_SCSI_HOST *hd, int init)
/* Post the chain buffers to the FreeChainQ.
*/
mem
=
(
u8
*
)
hd
->
ChainBuffer
;
for
(
ii
=
0
;
ii
<
num
C
hain
;
ii
++
)
{
for
(
ii
=
0
;
ii
<
num
_c
hain
;
ii
++
)
{
chain
=
(
MPT_FRAME_HDR
*
)
mem
;
Q_ADD_TAIL
(
&
hd
->
FreeChainQ
.
head
,
&
chain
->
u
.
frame
.
linkage
,
MPT_FRAME_HDR
);
mem
+=
hd
->
ioc
->
req_sz
;
...
...
@@ -1227,7 +1260,7 @@ mptscsih_detect(Scsi_Host_Template *tpnt)
#endif
sh
=
scsi_register
(
tpnt
,
sizeof
(
MPT_SCSI_HOST
));
if
(
sh
!=
NULL
)
{
mptscsih_
save_flags
(
flags
);
mptscsih_
lock
(
this
,
flags
);
sh
->
io_port
=
0
;
sh
->
n_io_port
=
0
;
sh
->
irq
=
0
;
...
...
@@ -1254,12 +1287,21 @@ mptscsih_detect(Scsi_Host_Template *tpnt)
}
sh
->
max_lun
=
MPT_LAST_LUN
+
1
;
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,7)
sh
->
max_sectors
=
MPT_SCSI_MAX_SECTORS
;
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,1)
sh
->
highmem_io
=
1
;
#endif
sh
->
this_id
=
this
->
pfacts
[
portnum
].
PortSCSIID
;
/* OS entry to allow host drivers to force
* a queue depth on a per device basis.
*/
sh
->
select_queue_depths
=
mptscsih_select_queue_depths
;
/* Required entry.
*/
sh
->
unique_id
=
this
->
id
;
/* Verify that we won't exceed the maximum
* number of chain buffers
...
...
@@ -1291,10 +1333,11 @@ mptscsih_detect(Scsi_Host_Template *tpnt)
*/
scsi_set_pci_device
(
sh
,
this
->
pcidev
);
mptscsih_
restore_flags
(
flags
);
mptscsih_
unlock
(
this
,
flags
);
hd
=
(
MPT_SCSI_HOST
*
)
sh
->
hostdata
;
hd
->
ioc
=
this
;
hd
->
max_sge
=
sh
->
sg_tablesize
;
if
((
int
)
this
->
chip_type
>
(
int
)
FC929
)
hd
->
is_spi
=
1
;
...
...
@@ -1534,7 +1577,6 @@ mptscsih_release(struct Scsi_Host *host)
int
szc2chain
=
0
;
int
szchain
=
0
;
int
szQ
=
0
;
int
scale
;
/* Synchronize disk caches
*/
...
...
@@ -1542,13 +1584,6 @@ mptscsih_release(struct Scsi_Host *host)
sz1
=
sz2
=
sz3
=
0
;
if
(
hd
->
ioc
->
req_sz
<=
64
)
scale
=
MPT_SG_REQ_64_SCALE
;
else
if
(
hd
->
ioc
->
req_sz
<=
96
)
scale
=
MPT_SG_REQ_96_SCALE
;
else
scale
=
MPT_SG_REQ_128_SCALE
;
if
(
hd
->
ScsiLookup
!=
NULL
)
{
sz1
=
hd
->
ioc
->
req_depth
*
sizeof
(
void
*
);
kfree
(
hd
->
ScsiLookup
);
...
...
@@ -1556,19 +1591,19 @@ mptscsih_release(struct Scsi_Host *host)
}
if
(
hd
->
ReqToChain
!=
NULL
)
{
szr2chain
=
scale
*
hd
->
ioc
->
req_depth
*
sizeof
(
int
);
szr2chain
=
hd
->
ioc
->
req_depth
*
sizeof
(
int
);
kfree
(
hd
->
ReqToChain
);
hd
->
ReqToChain
=
NULL
;
}
if
(
hd
->
ChainToChain
!=
NULL
)
{
szc2chain
=
scale
*
hd
->
ioc
->
req_depth
*
sizeof
(
int
);
szc2chain
=
hd
->
num_chain
*
sizeof
(
int
);
kfree
(
hd
->
ChainToChain
);
hd
->
ChainToChain
=
NULL
;
}
if
(
hd
->
ChainBuffer
!=
NULL
)
{
sz2
=
scale
*
hd
->
ioc
->
req_depth
*
hd
->
ioc
->
req_sz
;
sz2
=
hd
->
num_chain
*
hd
->
ioc
->
req_sz
;
szchain
=
szr2chain
+
szc2chain
+
sz2
;
pci_free_consistent
(
hd
->
ioc
->
pcidev
,
sz2
,
...
...
@@ -1591,7 +1626,7 @@ mptscsih_release(struct Scsi_Host *host)
if
(
hd
->
is_spi
)
{
max
=
MPT_MAX_SCSI_DEVICES
;
}
else
{
max
=
MPT_MAX_FC_DEVICES
;
max
=
MPT_MAX_FC_DEVICES
<
256
?
MPT_MAX_FC_DEVICES
:
255
;
}
for
(
ii
=
0
;
ii
<
max
;
ii
++
)
{
if
(
hd
->
Targets
[
ii
])
{
...
...
@@ -1805,6 +1840,7 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
dmfprintk
((
MYIOC_s_INFO_FMT
"qcmd: SCpnt=%p, done()=%p
\n
"
,
(
hd
&&
hd
->
ioc
)
?
hd
->
ioc
->
name
:
"ioc?"
,
SCpnt
,
done
));
#ifdef MPT_SAVE_AUTOSENSE
/* 20000617 -sralston
* GRRRRR... Shouldn't have to do this but...
* Do explicit check for REQUEST_SENSE and cached SenseData.
...
...
@@ -1840,6 +1876,7 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
}
}
}
#endif
if
(
hd
->
resetPending
)
{
/* Prevent new commands from being issued
...
...
@@ -2020,7 +2057,8 @@ mptscsih_qcmd(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
if
(
!
dvtaskQ_active
)
{
dvtaskQ_active
=
1
;
spin_unlock_irqrestore
(
&
dvtaskQ_lock
,
lflags
);
INIT_WORK
(
&
mptscsih_dvTask
,
mptscsih_domainValidation
,
(
void
*
)
hd
);
MPT_INIT_WORK
(
&
mptscsih_dvTask
,
mptscsih_domainValidation
,
(
void
*
)
hd
);
SCHEDULE_TASK
(
&
mptscsih_dvTask
);
}
else
{
spin_unlock_irqrestore
(
&
dvtaskQ_lock
,
lflags
);
...
...
@@ -3046,7 +3084,7 @@ mptscsih_old_abort(Scsi_Cmnd *SCpnt)
{
MPT_SCSI_HOST
*
hd
;
MPT_FRAME_HDR
*
mf
;
struct
work_struct
*
ptaskfoo
;
struct
mpt_
work_struct
*
ptaskfoo
;
unsigned
long
flags
;
int
scpnt_idx
;
...
...
@@ -3154,10 +3192,8 @@ mptscsih_old_abort(Scsi_Cmnd *SCpnt)
* Oh how cute, no alloc/free/mgmt needed if we use
* (bottom/unused portion of) MPT request frame.
*/
ptaskfoo
=
(
struct
work_struct
*
)
&
mptscsih_ptaskfoo
;
ptaskfoo
->
sync
=
0
;
ptaskfoo
->
routine
=
mptscsih_taskmgmt_bh
;
ptaskfoo
->
data
=
SCpnt
;
ptaskfoo
=
(
struct
mpt_work_struct
*
)
&
mptscsih_ptaskfoo
;
MPT_INIT_WORK
(
&
mptscsih_ptaskfoo
,
mptscsih_taskmgmt_bh
,
(
void
*
)
SCpnt
);
SCHEDULE_TASK
(
ptaskfoo
);
}
else
{
...
...
@@ -3182,7 +3218,7 @@ mptscsih_old_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags)
{
MPT_SCSI_HOST
*
hd
;
MPT_FRAME_HDR
*
mf
;
struct
work_struct
*
ptaskfoo
;
struct
mpt_
work_struct
*
ptaskfoo
;
unsigned
long
flags
;
int
scpnt_idx
;
...
...
@@ -3284,10 +3320,8 @@ mptscsih_old_reset(Scsi_Cmnd *SCpnt, unsigned int reset_flags)
* Oh how cute, no alloc/free/mgmt needed if we use
* (bottom/unused portion of) MPT request frame.
*/
ptaskfoo
=
(
struct
work_struct
*
)
&
mptscsih_ptaskfoo
;
ptaskfoo
->
sync
=
0
;
ptaskfoo
->
routine
=
mptscsih_taskmgmt_bh
;
ptaskfoo
->
data
=
SCpnt
;
ptaskfoo
=
(
struct
mpt_work_struct
*
)
&
mptscsih_ptaskfoo
;
MPT_INIT_WORK
(
&
mptscsih_ptaskfoo
,
mptscsih_taskmgmt_bh
,
(
void
*
)
SCpnt
);
SCHEDULE_TASK
(
ptaskfoo
);
}
else
{
...
...
@@ -3655,7 +3689,7 @@ mptscsih_select_queue_depths(struct Scsi_Host *sh, Scsi_Device *sdList)
if
(
hd
->
is_spi
)
max
=
MPT_MAX_SCSI_DEVICES
;
else
max
=
MPT_MAX_FC_DEVICES
;
max
=
MPT_MAX_FC_DEVICES
<
256
?
MPT_MAX_FC_DEVICES
:
255
;
for
(
ii
=
0
;
ii
<
max
;
ii
++
)
{
pTarget
=
hd
->
Targets
[
ii
];
...
...
@@ -3801,6 +3835,7 @@ copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply
/* save sense data to the target device
*/
if
(
target
)
{
#ifdef MPT_SAVE_AUTOSENSE
int
sz
;
sz
=
MIN
(
pReq
->
SenseBufferLength
,
sense_count
);
...
...
@@ -3808,6 +3843,7 @@ copy_sense_data(Scsi_Cmnd *sc, MPT_SCSI_HOST *hd, MPT_FRAME_HDR *mf, SCSIIOReply
sz
=
SCSI_STD_SENSE_BYTES
;
memcpy
(
target
->
sense
,
sense_data
,
sz
);
target
->
tflags
|=
MPT_TARGET_FLAGS_VALID_SENSE
;
#endif
#ifdef ABORT_FIX
if
(
sz
>=
SCSI_STD_SENSE_BYTES
)
{
...
...
@@ -4491,6 +4527,7 @@ static int dump_cdb(char *foo, unsigned char *cdb)
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
#if 0
static int dump_sd(char *foo, unsigned char *sd)
{
int snsLen = 8 + SD_Additional_Sense_Length(sd);
...
...
@@ -4503,6 +4540,7 @@ static int dump_sd(char *foo, unsigned char *sd)
return l;
}
#endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/* Do ASC/ASCQ lookup/grindage to English readable string(s) */
...
...
@@ -4593,6 +4631,15 @@ static const char * ascq_set_strings_4max(
}
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* SCSI Information Report; desired output format...
*---
SCSI Error: (iocnum:target_id:LUN) Status=02h (CHECK CONDITION)
Key=6h (UNIT ATTENTION); FRU=03h
ASC/ASCQ=29h/00h, "POWER ON, RESET, OR BUS DEVICE RESET OCCURRED"
CDB: 00 00 00 00 00 00 - TestUnitReady
*---
*/
/*
* SCSI Error Report; desired output format...
*---
...
...
@@ -4617,6 +4664,22 @@ int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop)
unsigned
char
ascq
=
SD_ASCQ
(
ioop
->
sensePtr
);
int
l
;
/* Change the error logging to only report errors on
* read and write commands. Ignore errors on other commands.
* Should this be configurable via proc?
*/
switch
(
ioop
->
cdbPtr
[
0
])
{
case
READ_6
:
case
WRITE_6
:
case
READ_10
:
case
WRITE_10
:
case
READ_12
:
case
WRITE_12
:
break
;
default:
return
0
;
}
/*
* More quiet mode.
* Filter out common, repetitive, warning-type errors... like:
...
...
@@ -4627,6 +4690,7 @@ int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop)
if
(
sk
==
SK_NO_SENSE
)
{
return
0
;
}
if
(
(
sk
==
SK_UNIT_ATTENTION
&&
asc
==
0x29
&&
(
ascq
==
0x00
||
ascq
==
0x01
))
||
(
sk
==
SK_NOT_READY
&&
asc
==
0x04
&&
(
ascq
==
0x01
||
ascq
==
0x02
))
||
(
sk
==
SK_ILLEGAL_REQUEST
&&
asc
==
0x25
&&
ascq
==
0x00
)
...
...
@@ -4681,20 +4745,12 @@ int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop)
else
if
(
mpt_ScsiOpcodesPtr
)
opstr
=
mpt_ScsiOpcodesPtr
[
ioop
->
cdbPtr
[
0
]];
l
=
sprintf
(
foo
,
"SCSI Error Report =-=-= (%s)
\n
"
" SCSI_Status=%02Xh (%s)
\n
"
" Original_CDB[]:"
,
ioop
->
DevIDStr
,
ioop
->
SCSIStatus
,
statstr
);
l
+=
dump_cdb
(
foo
+
l
,
ioop
->
cdbPtr
);
if
(
opstr
)
l
+=
sprintf
(
foo
+
l
,
" -
\"
%s
\"
"
,
opstr
);
l
+=
sprintf
(
foo
+
l
,
"
\n
SenseData[%02Xh]:"
,
8
+
SD_Additional_Sense_Length
(
ioop
->
sensePtr
));
l
+=
dump_sd
(
foo
+
l
,
ioop
->
sensePtr
);
l
+=
sprintf
(
foo
+
l
,
"
\n
SenseKey=%Xh (%s); FRU=%02Xh
\n
ASC/ASCQ=%02Xh/%02Xh"
,
sk
,
skstr
,
SD_FRU
(
ioop
->
sensePtr
),
asc
,
ascq
);
l
=
sprintf
(
foo
,
"SCSI Error: (%s) Status=%02Xh (%s)
\n
"
,
ioop
->
DevIDStr
,
ioop
->
SCSIStatus
,
statstr
);
l
+=
sprintf
(
foo
+
l
,
" Key=%Xh (%s); FRU=%02Xh
\n
ASC/ASCQ=%02Xh/%02Xh"
,
sk
,
skstr
,
SD_FRU
(
ioop
->
sensePtr
),
asc
,
ascq
);
{
const
char
*
x1
,
*
x2
,
*
x3
,
*
x4
;
x1
=
x2
=
x3
=
x4
=
""
;
...
...
@@ -4706,11 +4762,11 @@ int mpt_ScsiHost_ErrorReport(IO_Info_t *ioop)
l
+=
sprintf
(
foo
+
l
,
" %s%s%s%s"
,
x1
,
x2
,
x3
,
x4
);
}
}
#if 0
if (
SPECIAL_ASCQ(asc,ascq)
)
l += sprintf(foo+l, "
(%02Xh)", ascq
);
#endif
l
+=
sprintf
(
foo
+
l
,
"
\n
CDB:"
);
l
+=
dump_cdb
(
foo
+
l
,
ioop
->
cdbPtr
);
if
(
opstr
)
l
+=
sprintf
(
foo
+
l
,
"
-
\"
%s
\"
"
,
opstr
);
l
+=
sprintf
(
foo
+
l
,
"
\n
"
);
PrintF
((
"%s
\n
"
,
foo
));
...
...
@@ -4953,6 +5009,7 @@ void mptscsih_setTargetNegoParms(MPT_SCSI_HOST *hd, VirtDevice *target, char byt
return
;
}
#ifdef MPT_SAVE_AUTOSENSE
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
* Clear sense valid flag.
...
...
@@ -4968,6 +5025,7 @@ static void clear_sense_flag(MPT_SCSI_HOST *hd, SCSIIORequest_t *pReq)
return
;
}
#endif
/* If DV disabled (negoNvram set to USE_NVARM) or if not LUN 0, return.
* Else set the NEED_DV flag after Read Capacity Issued (disks)
...
...
@@ -5366,7 +5424,9 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
/* If target struct exists, clear sense valid flag.
*/
#ifdef MPT_SAVE_AUTOSENSE
clear_sense_flag
(
hd
,
pReq
);
#endif
if
(
mr
==
NULL
)
{
completionCode
=
MPT_SCANDV_GOOD
;
...
...
@@ -5418,7 +5478,9 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
completionCode
=
MPT_SCANDV_SOME_ERROR
;
}
else
if
(
pReply
->
SCSIState
&
MPI_SCSI_STATE_AUTOSENSE_VALID
)
{
#ifdef MPT_SAVE_AUTOSENSE
VirtDevice
*
target
;
#endif
u8
*
sense_data
;
int
sz
;
...
...
@@ -5433,12 +5495,14 @@ mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *mr)
SCSI_STD_SENSE_BYTES
);
memcpy
(
hd
->
pLocal
->
sense
,
sense_data
,
sz
);
#ifdef MPT_SAVE_AUTOSENSE
target
=
hd
->
Targets
[
pReq
->
TargetID
];
if
(
target
)
{
memcpy
(
target
->
sense
,
sense_data
,
sz
);
target
->
tflags
|=
MPT_TARGET_FLAGS_VALID_SENSE
;
}
#endif
ddvprintk
((
KERN_NOTICE
" Check Condition, sense ptr %p
\n
"
,
sense_data
));
...
...
drivers/message/fusion/mptscsih.h
View file @
53affa1a
...
...
@@ -20,7 +20,7 @@
* (mailto:netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptscsih.h,v 1.1
8 2002/06/06 15:32:52
pdelaney Exp $
* $Id: mptscsih.h,v 1.1
9 2002/10/03 13:10:15
pdelaney Exp $
*/
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*
...
...
@@ -77,7 +77,22 @@
#define MPT_SCSI_CAN_QUEUE MPT_FC_CAN_QUEUE
#define MPT_SCSI_CMD_PER_LUN 7
#define MPT_SCSI_MAX_SECTORS 8192
/*
* Set the MAX_SGE value based on user input.
*/
#ifdef CONFIG_FUSION_MAX_SGE
#if CONFIG_FUSION_MAX_SGE < 16
#define MPT_SCSI_SG_DEPTH 16
#elif CONFIG_FUSION_MAX_SGE > 128
#define MPT_SCSI_SG_DEPTH 128
#else
#define MPT_SCSI_SG_DEPTH CONFIG_FUSION_MAX_SGE
#endif
#else
#define MPT_SCSI_SG_DEPTH 40
#endif
/* To disable domain validation, uncomment the
* following line. No effect for FC devices.
...
...
@@ -146,25 +161,39 @@ struct mptscsih_driver_setup
/*
* tq_scheduler disappeared @ lk-2.4.0-test12
* (right when <linux/sched.h> newly defined TQ_ACTIVE)
* tq_struct reworked in 2.5.41. Include workqueue.h.
*/
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,41)
# include <linux/sched.h>
# include <linux/workqueue.h>
#define SCHEDULE_TASK(x) \
if (schedule_work(x) == 0) { \
/*MOD_DEC_USE_COUNT*/
; \
}
#else
#define HAVE_TQ_SCHED 1
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0)
# include <linux/sched.h>
# ifdef TQ_ACTIVE
# undef HAVE_TQ_SCHED
# endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,40)
# undef HAVE_TQ_SCHED
#endif
#endif
#ifdef HAVE_TQ_SCHED
#define SCHEDULE_TASK(x) \
/*MOD_INC_USE_COUNT*/
; \
schedule_work(x)
(x)->next = NULL; \
queue_task(x, &tq_scheduler)
#else
#define SCHEDULE_TASK(x) \
/*MOD_INC_USE_COUNT*/
; \
if (schedule_
wor
k(x) == 0) { \
if (schedule_
tas
k(x) == 0) { \
/*MOD_DEC_USE_COUNT*/
; \
}
#endif
#endif
/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
...
...
@@ -236,6 +265,7 @@ extern void x_scsi_taskmgmt_bh(void *);
can_queue: MPT_SCSI_CAN_QUEUE, \
this_id: -1, \
sg_tablesize: MPT_SCSI_SG_DEPTH, \
max_sectors: MPT_SCSI_MAX_SECTORS, \
cmd_per_lun: MPT_SCSI_CMD_PER_LUN, \
unchecked_isa_dma: 0, \
use_clustering: ENABLE_CLUSTERING, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment