Commit 53affa1a authored by Alan Cox's avatar Alan Cox Committed by Linus Torvalds

[PATCH] mpt fusion update from vendor

parent 75a97cd1
......@@ -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
......
......@@ -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?
......
......@@ -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 */
......@@ -6,7 +6,7 @@
* Title: MPI Message independent structures and definitions
* Creation Date: July 27, 2000
*
* MPI.H Version: 01.02.06
* MPI.H Version: 01.02.07
*
* 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 (0x07)
#define MPI_HEADER_VERSION_UNIT (0x09)
#define MPI_HEADER_VERSION_DEV (0x00)
#define MPI_HEADER_VERSION_UNIT_MASK (0xFF00)
#define MPI_HEADER_VERSION_UNIT_SHIFT (8)
......
......@@ -6,7 +6,7 @@
* Title: MPI Config message, structures, and Pages
* Creation Date: July 27, 2000
*
* MPI_CNFG.H Version: 01.02.08
* MPI_CNFG.H Version: 01.02.09
*
* 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
......
......@@ -6,7 +6,7 @@
* Title: MPI Target mode messages and structures
* Creation Date: June 22, 2000
*
* MPI_TARG.H Version: 01.02.06
* MPI_TARG.H Version: 01.02.07
*
* 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)
/*
......
......@@ -49,7 +49,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptbase.c,v 1.121 2002/07/23 18:56:59 pdelaney Exp $
* $Id: mptbase.c,v 1.122 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;
......
......@@ -13,7 +13,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptbase.h,v 1.133 2002/09/05 22:30:09 pdelaney Exp $
* $Id: mptbase.h,v 1.134 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.01"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.02.01.01"
#define MPT_LINUX_VERSION_COMMON "2.02.01.07"
#define MPT_LINUX_PACKAGE_NAME "@(#)mptlinux-2.02.01.07"
#define WHAT_MAGIC_STRING "@" "(" "#" ")"
#define show_mptmod_ver(s,ver) \
......@@ -91,7 +91,7 @@
/*
* Fusion MPT(linux) driver configurable stuff...
*/
#define MPT_MAX_ADAPTERS 16
#define MPT_MAX_ADAPTERS 18
#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;
......
......@@ -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_GETDRIVVER) || (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_GETDRIVVER:
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_GETDRIVVER, 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_GETDRIVVER);
unregister_ioctl32_conversion(CPQFCTS_CTLR_STATUS);
unregister_ioctl32_conversion(CPQFCTS_SCSI_IOCTL_FC_TARGET_ADDRESS);
unregister_ioctl32_conversion(CPQFCTS_SCSI_PASSTHRU32);
......
......@@ -20,7 +20,7 @@
* (mailto:sjralston1@netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptctl.h,v 1.10 2002/05/28 15:57:16 pdelaney Exp $
* $Id: mptctl.h,v 1.11 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_GETDRIVER _IOR(CPQFCTS_IOC_MAGIC, 2, int)
#define CPQFCTS_GETDRIVVER _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 {
......
......@@ -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",
......
......@@ -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>
......
This diff is collapsed.
......@@ -20,7 +20,7 @@
* (mailto:netscape.net)
* (mailto:Pam.Delaney@lsil.com)
*
* $Id: mptscsih.h,v 1.18 2002/06/06 15:32:52 pdelaney Exp $
* $Id: mptscsih.h,v 1.19 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_work(x) == 0) { \
if (schedule_task(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, \
......
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