Skip to content
Snippets Groups Projects
Commit dd70845b authored by (no author)'s avatar (no author)
Browse files

This commit was manufactured by cvs2svn to create tag

'ROOT_OF_RELEASE_5_33_WITH_MARVELL_SUPPORT'.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/tags/ROOT_OF_RELEASE_5_33_WITH_MARVELL_SUPPORT@1866 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent e97cabc1
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 13506 deletions
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.
---------------------------------------------------------------------------
# November 27, 2003
#
# This patch is now against the official 3ware version 1.02.00.036 3w-xxxx.c driver
# dated Wed Jul 16 20:30:28 2003. Instructions for use:
#
# [1] download the 1.02.00.036 3w-xxxx.c driver from
# http://www.3ware.com/support/download.asp
#
# [2] Unpack it:
# tar zxvf rh7x_8x.tgz (or su7x_8x.tgz for SuSE)
#
# [3] Unpack the source code, and move to the right directory:
# cd src/2.4
# tar zxvf 3w-xxxx.tgz
# cd driver
#
# [4] Copy THIS FILE (what you are reading!) into that
# directory and name it 3w-xxxx.txt
#
# [5] Patch the driver:
# patch < 3w-xxxx.txt
# You should get the response 'patching file 3w-xxxx.c'.
#
# [6] Build the driver with the command:
# make
# This will create the driver: a file named 3w-xxxx.o
#
# [7] Load the driver (you must be root to do this):
# /sbin/insmod ./3w-xxxx.o
# [Note: if '/sbin/lsmod' shows that the driver is loaded already,
# then unmount any file systems that use it, then unload the driver
# with '/sbin/rmmod 3w-xxxx' first!]
#
# [8] Copy the driver into place in the kernel tree:
# cp ./3w-xxxx.o /lib/modules/`uname -r`/kernel/drivers/scsi
# That's it!
#
# August 14, 2003
#
# Adam Radford has incorporated a change that now allows the 3w-xxxx
# driver to return the Cylinder Low/High values. These are needed to
# get the SMART health status. This patch incorporates those changes
# as well.
#
# August 12, 2003
#
# 3ware has incorporated a more general version of this fix into their latest
# 3w-xxxx driver release. Rather than using this patch, you can upgrade your
# 3w-xxxx driver to version 1.02.00.037 or greater. Or you can use this patch.
#
# August 8, 2003
# PATCH FOR 3WARE 3w-xxxx DRIVER
# Bruce Allen ballen at gravity.phys.uwm.edu
# CVS ID of this file: $Id: 3w-xxxx.txt,v 1.5 2003/11/28 17:58:50 ballen4705 Exp $
#
# To apply this patch, save this entire file to 3w-xxxx.txt in a
# directory containing the original unpatched 3w-xxxx.c file. Then
# given the command:
# patch < 3w-xxxx.txt
# That's it!
#
# TECHNICAL EXPLANATION OF THE PATCH FOLLOWS. SKIP IT IF YOU DON'T CARE.
#
# The 3w-xxxx SCSI RAID driver for 3ware Escalade controller cards has a bug
# in the "passthru" ioctl() which prevents two SMART commands from being
# passed to the ATA devices behind the controller. The commands are:
#
# SMART ENABLE/DISABLE ATTRIBUTE AUTOSAVE
# (Command Register=0xB0/Feature Register=0xD2)
#
# SMART ENABLE/DISABLE AUTOMATIC OFF-LINE
# (Command Register=0xB0/Feature Register=0xDB)
#
# [Note: the second of these commands is listed as "Obsolete" in the ATA
# specifications. It was originally defined in SFF-8035i. Most vendors
# (IBM/Hitachi, Maxtor, Samsung, WD, among others) still implement it for
# backwards compatibility.]
#
# The problem arises because in both cases (stupidly!) the ENABLE subcommand
# is indicated with a nonzero value of the Sector Count Register. For the
# AUTOSAVE command one uses Sector Count Register=0xF1 and for the AUTOMATIC
# OFF-LINE command one uses Sector Count Register=0xF8.
#
# This provokes the following error messages from the 3w-xxxx driver:
# 3w-xxxx: tw_ioctl(): Passthru size (123392) too big.
# 3w-xxxx: tw_ioctl(): Passthru size (126976) too big.
# and the driver doesn't pass the ATA command on. This is because the
# passthru part of the 3w-xxxx driver assumes that the value in the Sector
# Count Register is the number of 512-byte blocks to transfer, and these
# values exceed the internal buffer sizes.
#
# In fact both of these are non-data commands, and so this is trivial to
# fix. I am attaching an 8-line patch for this purpose. It looks for these
# particular commands and then treats them as non-data commands. It has been
# tested on both a 6800 and a 7500 controller, and should be endian-order
# and 32/64-bit clean.
#
# [Note: the normal linux ide drivers also assume that the Sector Count
# Register is the number of 512-byte sectors to transfer to user space.
# But in that case the user can simply allocate a userland buffer large
# enough to hold the 0xf1*0x200 or 0xf8*0x200 bytes, and then ignore the
# contents.]
#
# -----------------------------------------------------------------------
--- 3w-xxxx.c.orig Wed Jul 16 20:30:28 2003
+++ 3w-xxxx.c Thu Nov 27 11:20:25 2003
@@ -173,6 +173,9 @@
1.02.00.035 - Improve tw_allocate_memory() memory allocation.
Fix tw_chrdev_ioctl() to sleep correctly.
1.02.00.036 - Increase character ioctl timeout to 60 seconds.
+
+ This version 1.02.00.036 3w-xxxx.c driver has been patched for full smartmontools support.
+
*/
#include <linux/module.h>
@@ -1930,12 +1933,15 @@
}
passthru = (TW_Passthru *)tw_dev->command_packet_virtual_address[request_id];
- passthru->sg_list[0].length = passthru->sector_count*512;
- if (passthru->sg_list[0].length > TW_MAX_PASSTHRU_BYTES) {
- printk(KERN_WARNING "3w-xxxx: tw_ioctl(): Passthru size (%d) too big.\n", passthru->sg_list[0].length);
- return 1;
+ /* Don't load sg_list for non-data ATA cmds */
+ if ((passthru->param != 0) && (passthru->param != 0x8)) {
+ passthru->sg_list[0].length = passthru->sector_count*512;
+ if (passthru->sg_list[0].length > TW_MAX_PASSTHRU_BYTES) {
+ printk(KERN_WARNING "3w-xxxx: tw_ioctl(): Passthru size (%d) too big.\n", passthru->sg_list[0].length);
+ return 1;
+ }
+ passthru->sg_list[0].address = tw_dev->alignment_physical_address[request_id];
}
- passthru->sg_list[0].address = tw_dev->alignment_physical_address[request_id];
tw_post_command_packet(tw_dev, request_id);
return 0;
case TW_CMD_PACKET:
@@ -2185,8 +2191,15 @@
ioctl = (TW_Ioctl *)buff;
switch (ioctl->opcode) {
case TW_ATA_PASSTHRU:
- passthru = (TW_Passthru *)ioctl->data;
- memcpy(buff, tw_dev->alignment_virtual_address[request_id], passthru->sector_count * 512);
+ passthru = (TW_Passthru *)ioctl->data;
+ /* Don't return data for non-data ATA cmds */
+ if ((passthru->param != 0) && (passthru->param != 0x8))
+ memcpy(buff, tw_dev->alignment_virtual_address[request_id], passthru->sector_count * 512);
+ else {
+ /* For non-data cmds, return cmd pkt */
+ if (tw_dev->srb[request_id]->request_bufflen >= sizeof(TW_Command))
+ memcpy(buff, tw_dev->command_packet_virtual_address[request_id], sizeof(TW_Command));
+ }
break;
case TW_CMD_PACKET_WITH_DATA:
dprintk(KERN_WARNING "3w-xxxx: tw_ioctl_complete(): caught TW_CMD_PACKET_WITH_DATA.\n");
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
#!/bin/bash
# execute this script in the current shell, using for example
# . cvs_script
unset CVS_SERVER
export CVS_RSH=ssh
export CVSROOT=:ext:ballen4705@cvs.sourceforge.net:/cvsroot/smartmontools
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment