Commit f5d76f2d authored by James Bottomley's avatar James Bottomley

megaraid_mbox 2.20.4.3 patch

From: 	Ju, Seokmann <sju@lsil.com>

- sysfs support for drive addition/removal
- Tape drive timeout issue
- Made some code static
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 8daeca52
Release Date : Thu Feb 03 12:27:22 EST 2005 - Seokmann Ju <sju@lsil.com>
Current Version : 2.20.4.5 (scsi module), 2.20.2.5 (cmm module)
Older Version : 2.20.4.4 (scsi module), 2.20.2.4 (cmm module)
1. Modified name of two attributes in scsi_host_template.
On Wed, 2005-02-02 at 10:56 -0500, Ju, Seokmann wrote:
> + .sdev_attrs = megaraid_device_attrs,
> + .shost_attrs = megaraid_class_device_attrs,
These are, perhaps, slightly confusing names.
The terms device and class_device have well defined meanings in the
generic device model, neither of which is what you mean here.
Why not simply megaraid_sdev_attrs and megaraid_shost_attrs?
Other than this, it looks fine to me too.
Release Date : Thu Jan 27 00:01:03 EST 2005 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.4.4 (scsi module), 2.20.2.5 (cmm module)
Older Version : 2.20.4.3 (scsi module), 2.20.2.4 (cmm module)
1. Bump up the version of scsi module due to its conflict.
Release Date : Thu Jan 21 00:01:03 EST 2005 - Atul Mukker <atulm@lsil.com>
Current Version : 2.20.4.3 (scsi module), 2.20.2.5 (cmm module)
Older Version : 2.20.4.2 (scsi module), 2.20.2.4 (cmm module)
1. Remove driver ioctl for logical drive to scsi address translation and
replace with the sysfs attribute. To remove drives and change
capacity, application shall now use the device attribute to get the
logical drive number for a scsi device. For adding newly created
logical drives, class device attribute would be required to uniquely
identify each controller.
- Atul Mukker <atulm@lsil.com>
"James, I've been thinking about this a little more, and you may be on
to something here. Let each driver add files as such:"
- Matt Domsch <Matt_Domsch@dell.com>, 12.15.2004
linux-scsi mailing list
"Then, if you simply publish your LD number as an extra parameter of
the device, you can look through /sys to find it."
- James Bottomley <James.Bottomley@SteelEye.com>, 01.03.2005
linux-scsi mailing list
"I don't see why not ... it's your driver, you can publish whatever
extra information you need as scsi_device attributes; that was one of
the designs of the extensible attribute system."
- James Bottomley <James.Bottomley@SteelEye.com>, 01.06.2005
linux-scsi mailing list
2. Add AMI megaraid support - Brian King <brking@charter.net>
PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID3,
PCI_VENDOR_ID_AMI, PCI_SUBSYS_ID_PERC3_DC,
3. Make some code static - Adrian Bunk <bunk@stusta.de>
Date: Mon, 15 Nov 2004 03:14:57 +0100
The patch below makes some needlessly global code static.
-wait_queue_head_t wait_q;
+static wait_queue_head_t wait_q;
Signed-off-by: Adrian Bunk <bunk@stusta.de>
4. Added NEC ROMB support - NEC MegaRAID PCI Express ROMB controller
PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_MEGARAID_NEC_ROMB_2E,
PCI_SUBSYS_ID_NEC, PCI_SUBSYS_ID_MEGARAID_NEC_ROMB_2E,
5. Fixed Tape drive issue : For any Direct CDB command to physical device
including tape, timeout value set by driver was 10 minutes. With this
value, most of command will return within timeout. However, for those
command like ERASE or FORMAT, it takes more than an hour depends on
capacity of the device and the command could be terminated before it
completes.
To address this issue, the 'timeout' field in the DCDB command will
have NO TIMEOUT (i.e., 4) value as its timeout on DCDB command.
Release Date : Thu Dec 9 19:10:23 EST 2004
- Sreenivas Bagalkote <sreenib@lsil.com>
Current Version : 2.20.4.2 (scsi module), 2.20.2.4 (cmm module)
Older Version : 2.20.4.1 (scsi module), 2.20.2.3 (cmm module)
i. Introduced driver ioctl that returns scsi address for a given ld.
"Why can't the existing sysfs interfaces be used to do this?"
- Brian King (brking@us.ibm.com)
"I've looked into solving this another way, but I cannot see how
to get this driver-private mapping of logical drive number-> HCTL
without putting code something like this into the driver."
"...and by providing a mapping a function to userspace, the driver
is free to change its mapping algorithm in the future if necessary .."
- Matt Domsch (Matt_Domsch@dell.com)
Release Date : Thu Dec 9 19:02:14 EST 2004 - Sreenivas Bagalkote <sreenib@lsil.com>
Current Version : 2.20.4.1 (scsi module), 2.20.2.3 (cmm module)
......@@ -13,7 +115,7 @@ Older Version : 2.20.4.0 (scsi module), 2.20.2.1 (cmm module)
i. Handle IOCTL cmd timeouts more properly.
ii. pci_dma_sync_{sg,single}_for_cpu was introduced into megaraid_mbox
incorrectly (instead of _for_device). Changed to appropriate
incorrectly (instead of _for_device). Changed to appropriate
pci_dma_sync_{sg,single}_for_device.
Release Date : Wed Oct 06 11:15:29 EDT 2004 - Sreenivas Bagalkote <sreenib@lsil.com>
......
......@@ -59,6 +59,7 @@ config MEGARAID_MAILBOX
INTEL RAID Controller SRCU51L 1000:1960:8086:0520
FSC MegaRAID PCI Express ROMB 1000:0408:1734:1065
ACER MegaRAID ROMB-2E 1000:0408:1025:004D
NEC MegaRAID PCI Express ROMB 1000:0408:1033:8287
To compile this driver as a module, choose M here: the
module will be called megaraid_mbox
......
......@@ -221,6 +221,9 @@ typedef struct {
#define MRAID_IS_LOGICAL(adp, scp) \
(SCP2CHANNEL(scp) == (adp)->max_channel) ? 1 : 0
#define MRAID_IS_LOGICAL_SDEV(adp, sdev) \
(sdev->channel == (adp)->max_channel) ? 1 : 0
#define MRAID_GET_DEVICE_MAP(adp, scp, p_chan, target, islogical) \
/* \
* Is the request coming for the virtual channel \
......
......@@ -291,5 +291,6 @@ typedef struct mraid_mmadp {
int mraid_mm_register_adp(mraid_mmadp_t *);
int mraid_mm_unregister_adp(uint32_t);
uint32_t mraid_mm_adapter_app_handle(uint32_t);
#endif /* _MEGARAID_IOCTL_H_ */
This diff is collapsed.
......@@ -21,8 +21,8 @@
#include "megaraid_ioctl.h"
#define MEGARAID_VERSION "2.20.4.1"
#define MEGARAID_EXT_VERSION "(Release Date: Thu Nov 4 17:44:59 EST 2004)"
#define MEGARAID_VERSION "2.20.4.5"
#define MEGARAID_EXT_VERSION "(Release Date: Thu Feb 03 12:27:22 EST 2005)"
/*
......@@ -137,6 +137,9 @@
#define PCI_SUBSYS_ID_PERC3_DC 0x0493
#define PCI_SUBSYS_ID_PERC3_SC 0x0475
#define PCI_DEVICE_ID_MEGARAID_NEC_ROMB_2E 0x0408
#define PCI_SUBSYS_ID_MEGARAID_NEC_ROMB_2E 0x8287
#ifndef PCI_SUBSYS_ID_FSC
#define PCI_SUBSYS_ID_FSC 0x1734
#endif
......@@ -216,6 +219,14 @@ typedef struct {
* @param hw_error : set if FW not responding
* @param fast_load : If set, skip physical device scanning
* @channel_class : channel class, RAID or SCSI
* @sysfs_sem : semaphore to serialize access to sysfs res.
* @sysfs_uioc : management packet to issue FW calls from sysfs
* @sysfs_mbox64 : mailbox packet to issue FW calls from sysfs
* @sysfs_buffer : data buffer for FW commands issued from sysfs
* @sysfs_buffer_dma : DMA buffer for FW commands issued from sysfs
* @sysfs_wait_q : wait queue for sysfs operations
* @random_del_supported : set if the random deletion is supported
* @curr_ldmap : current LDID map
*
* Initialization structure for mailbox controllers: memory based and IO based
* All the fields in this structure are LLD specific and may be discovered at
......@@ -223,6 +234,7 @@ typedef struct {
*
* NOTE: The fields of this structures are placed to minimize cache misses
*/
#define MAX_LD_EXTENDED64 64
typedef struct {
mbox64_t *una_mbox64;
dma_addr_t una_mbox64_dma;
......@@ -247,6 +259,14 @@ typedef struct {
int hw_error;
int fast_load;
uint8_t channel_class;
struct semaphore sysfs_sem;
uioc_t *sysfs_uioc;
mbox64_t *sysfs_mbox64;
caddr_t sysfs_buffer;
dma_addr_t sysfs_buffer_dma;
wait_queue_head_t sysfs_wait_q;
int random_del_supported;
uint16_t curr_ldmap[MAX_LD_EXTENDED64];
} mraid_device_t;
// route to raid device from adapter
......
......@@ -10,7 +10,7 @@
* 2 of the License, or (at your option) any later version.
*
* FILE : megaraid_mm.c
* Version : v2.20.2.3 (Dec 09 2004)
* Version : v2.20.2.5 (Jan 21 2005)
*
* Common management module
*/
......@@ -58,6 +58,7 @@ MODULE_PARM_DESC(dlevel, "Debug level (default=0)");
EXPORT_SYMBOL(mraid_mm_register_adp);
EXPORT_SYMBOL(mraid_mm_unregister_adp);
EXPORT_SYMBOL(mraid_mm_adapter_app_handle);
static int majorno;
static uint32_t drvr_ver = 0x02200201;
......@@ -65,7 +66,7 @@ static uint32_t drvr_ver = 0x02200201;
static int adapters_count_g;
static struct list_head adapters_list_g;
wait_queue_head_t wait_q;
static wait_queue_head_t wait_q;
static struct file_operations lsi_fops = {
.open = mraid_mm_open,
......@@ -1007,6 +1008,40 @@ mraid_mm_register_adp(mraid_mmadp_t *lld_adp)
return rval;
}
/**
* mraid_mm_adapter_app_handle - return the application handle for this adapter
*
* For the given driver data, locate the adadpter in our global list and
* return the corresponding handle, which is also used by applications to
* uniquely identify an adapter.
*
* @param unique_id : adapter unique identifier
*
* @return adapter handle if found in the list
* @return 0 if adapter could not be located, should never happen though
*/
uint32_t
mraid_mm_adapter_app_handle(uint32_t unique_id)
{
mraid_mmadp_t *adapter;
mraid_mmadp_t *tmp;
int index = 0;
list_for_each_entry_safe(adapter, tmp, &adapters_list_g, list) {
if (adapter->unique_id == unique_id) {
return MKADAP(index);
}
index++;
}
return 0;
}
/**
* mraid_mm_setup_dma_pools - Set up dma buffer pools per adapter
*
......
......@@ -29,9 +29,10 @@
#include "megaraid_ioctl.h"
#define LSI_COMMON_MOD_VERSION "2.20.2.3"
#define LSI_COMMON_MOD_VERSION "2.20.2.5"
#define LSI_COMMON_MOD_EXT_VERSION \
"(Release Date: Thu Dec 9 19:02:14 EST 2004)"
"(Release Date: Fri Jan 21 00:01:03 EST 2005)"
#define LSI_DBGLVL dbglevel
......
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