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

This commit was manufactured by cvs2svn to create tag 'RELEASE_5_22'.

parent c8bcef18
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 6607 deletions
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
---------------------------------------------------------------------------
# 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.3 2003/08/14 14:56:07 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.save Thu Aug 14 16:28:35 2003
+++ 3w-xxxx.c Thu Aug 14 16:44:04 2003
@@ -1915,12 +1915,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:
@@ -2170,8 +2173,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.
# Manufactures HTML file from XML file. Note: do NOT edit the HTML
# file, only the XML file.
all: smartmontools_scsi.html
smartmontools_scsi.html: smartmontools_scsi.xml
xmlto html-nochunks smartmontools_scsi.xml
upload: smartmontools_scsi.html index.html
scp smartmontools_scsi.html ballen4705@smartmontools.sourceforge.net:/home/groups/s/sm/smartmontools/htdocs
scp 3w-xxxx.txt ballen4705@smartmontools.sourceforge.net:/home/groups/s/sm/smartmontools/htdocs
scp index.html ballen4705@smartmontools.sourceforge.net:/home/groups/s/sm/smartmontools/htdocs
scp examples/*.html ballen4705@smartmontools.sourceforge.net:/home/groups/s/sm/smartmontools/htdocs/examples
scp examples/*.txt ballen4705@smartmontools.sourceforge.net:/home/groups/s/sm/smartmontools/htdocs/examples
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.0.7 (GNU/Linux)
mQGiBD9XAXIRBACgLEphBmhUKWE1mRKzjkq/8vZHtJsVUiFivcbxaSLa9jBbJoZV
sQk5fdcleVE6CcuodMetVE6Gl8uM4W4iymp0i35lwefdgmUzJYmza1ZD7Uk0x4zv
tKi9xZ9Hc+yrf4SHRwL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Jtm3xrQZLId/W
RAo+Qqn5Or+sugZZpQPHrGGB9TTc0AL3MfCbK4mlssVhS0SAq35E/osCLQcor7Sx
sohPBBgRAgAPBQI/VwF4AhsMBQkCeNAAAAoJECM+HzqbsZoi4WUAn2IQhEtHY/48
4rljbro8yUwYlrXzAJ44VfTwmjLlI9aoYdRW/cTtZ0tPgw==
=f2kQ
-----END PGP PUBLIC KEY BLOCK-----
#!/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.smartmontools.sourceforge.net:/cvsroot/smartmontools
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.
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