[8832] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

[patch] aha152x driver

daemon@ATHENA.MIT.EDU (Juergen E Fischer)
Wed May 17 12:38:57 2000

From: Juergen E Fischer <jfischer@surf1.de>
Date:	Wed, 17 May 2000 18:30:17 +0200
To: linux-scsi@vger.rutgers.edu
Message-ID: <20000517183017.A22542@linux-buechse.de>
Reply-To: fischer@norbit.de
Mail-Followup-To: linux-scsi@vger.rutgers.edu
Mime-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature"; boundary="CE+1k2dSO48ffgeK"
Content-Disposition: inline


--CE+1k2dSO48ffgeK
Content-Type: text/plain; charset=latin1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi there,

a little patch for the aha152x driver which fixes a problem
with writing audio cd (i.e. w/o sg buffers).

J=FCrgen


--- drivers/scsi/aha152x.c.orig	Tue May 16 18:57:29 2000
+++ drivers/scsi/aha152x.c	Wed May 17 18:23:53 2000
@@ -13,9 +13,13 @@
  * General Public License for more details.
  *
  *
- * $Id: aha152x.c,v 2.0 1999/12/25 15:07:32 fischer Exp fischer $
+ * $Id: aha152x.c,v 2.1 2000/05/17 16:23:17 fischer Exp fischer $
  *
  * $Log: aha152x.c,v $
+ * Revision 2.1  2000/05/17 16:23:17  fischer
+ * - signature update
+ * - fix for data out w/o scatter gather
+ *
  * Revision 2.0  1999/12/25 15:07:32  fischer
  * - interrupt routine completly reworked
  * - basic support for new eh code
@@ -202,7 +206,7 @@
=20
 #include <linux/module.h>
=20
-#ifdef PCMCIA
+#if defined(PCMCIA)
 #undef MODULE
 #endif
=20
@@ -275,7 +279,6 @@
 #define DPRINTK(when,msgs...)
 #define	DO_LOCK(flags)		spin_lock_irqsave(&QLOCK,flags)
 #define	DO_UNLOCK(flags)	spin_unlock_irqrestore(&QLOCK,flags)
-#define DEBUG_DEFAULT	0
 #endif
=20
 #define LEAD		"(scsi%d:%d:%d) "
@@ -1714,7 +1717,9 @@
  */
 int aha152x_host_reset(Scsi_Cmnd * SCpnt)
 {
+#if defined(AHA152X_DEBUG)
 	struct Scsi_Host *shpnt =3D SCpnt->host;
+#endif
=20
 	DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", CMDINFO(SCpnt), =
SCpnt);
=20
@@ -2731,14 +2736,19 @@
=20
 		CURRENT_SC->resid +=3D data_count;
=20
-		data_count -=3D CURRENT_SC->SCp.ptr - CURRENT_SC->SCp.buffer->address;
-		while(data_count>0) {
-			CURRENT_SC->SCp.buffer--;
-			CURRENT_SC->SCp.buffers_residual++;
-			data_count -=3D CURRENT_SC->SCp.buffer->length;
+		if(CURRENT_SC->use_sg) {
+			data_count -=3D CURRENT_SC->SCp.ptr - CURRENT_SC->SCp.buffer->address;
+			while(data_count>0) {
+				CURRENT_SC->SCp.buffer--;
+				CURRENT_SC->SCp.buffers_residual++;
+				data_count -=3D CURRENT_SC->SCp.buffer->length;
+			}
+			CURRENT_SC->SCp.ptr           =3D CURRENT_SC->SCp.buffer->address - dat=
a_count;
+			CURRENT_SC->SCp.this_residual =3D CURRENT_SC->SCp.buffer->length + data=
_count;
+		} else {
+			CURRENT_SC->SCp.ptr           -=3D data_count;
+			CURRENT_SC->SCp.this_residual +=3D data_count;
 		}
-		CURRENT_SC->SCp.ptr           =3D CURRENT_SC->SCp.buffer->address - data=
_count;
-		CURRENT_SC->SCp.this_residual =3D CURRENT_SC->SCp.buffer->length + data_=
count;
 	}
=20
 	DPRINTK(debug_datao, DEBUG_LEAD "datao_end: request_bufflen=3D%d; resid=
=3D%d; stcnt=3D%d\n",

--=20
J=FCrgen E Fischer, JF3841-RIPE

"I hear that if you play the NT 4.0 CD backwards, you get a satanic message=
".
"That's nothing. If you play it forward, it installs NT 4.0!"

--CE+1k2dSO48ffgeK
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.1 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE5IskZc/GhTF5ESHURApuPAJ4le52mR7w9NEJ4hXjNO1iKO4b4OACfQgJT
CPE2XY+0/O2GPoYJFYWtUNY=
=nr/w
-----END PGP SIGNATURE-----

--CE+1k2dSO48ffgeK--

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post