[PARPORT] PARIDE updates to 2.0.35


grant@torque.net
Thu, 24 Sep 1998 18:48:34 -0400 (EDT)


Hi Alan

Below is a set of patches against 2.0.35. They retrofit the most recent
changes to the PARIDE drivers. The changes include:

        - enhanced debugging
        - improved error handling in the pcd driver
        - minor coding and documentation fixes
        - repairs to several protocol modules
        - timing corrections in several high level drivers
        - support for building single-module drivers

These patches do not include the support for playing audio CD-ROMs that
was recently incorporated into the 2.1 driver. (They require the
"uniform CD-ROM" interface.)

Please add these patches to the queue for 2.0.36.

diff -urN /scratch/linux-2.0.35.ref/Documentation/Configure.help linux/Documentation/Configure.help
--- /scratch/linux-2.0.35.ref/Documentation/Configure.help Wed Jul 29 20:22:08 1998
+++ linux/Documentation/Configure.help Thu Sep 24 13:05:58 1998
@@ -397,9 +397,11 @@
   The module will be called pg.o. You must also have at least one
   parallel port protocol driver in your system. This driver
   implements an API loosely related to the generic SCSI driver.
- See /usr/include/linux/pg.h for details, or visit
- http://www.torque.net/parport/cdr.html for more information and
- the required patches to cdrecord.
+ See /usr/include/linux/pg.h for details.
+
+ You can obtain the most recent version of cdrecord from
+ ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ . Versions 1.6.1a3 and
+ later fully support the pg driver.
 
 ATEN EH-100 protocol
 CONFIG_PARIDE_ATEN
diff -urN /scratch/linux-2.0.35.ref/Documentation/paride.txt linux/Documentation/paride.txt
--- /scratch/linux-2.0.35.ref/Documentation/paride.txt Wed Jul 29 20:22:09 1998
+++ linux/Documentation/paride.txt Thu Sep 24 13:12:01 1998
@@ -2,13 +2,13 @@
                 Linux and parallel port IDE devices
 
 
-PARIDE-2.0.35 (c) 1997-8 Grant Guenther <grant@torque.net>
+PARIDE-1.03s (c) 1997-8 Grant Guenther <grant@torque.net>
 
 *************************************************************************
 
-Special notes for the 2.0.35 version:
+Special notes for the 2.0 version:
 
-(i) This is the paride from 2.1.107 retrofitted to work with 2.0.34.
+(i) This is the paride from 2.1 retrofitted to work with 2.0.
      
 (ii) PARPORT is _not_ supported. If you obtain the PARPORT patches
       for 2.0 and try to use them, it might work. I have not tried
@@ -20,6 +20,9 @@
 (iv) I have not built or tested PARIDE with SMP support in 2.0.35,
       use it at your own risk.
 
+(v) The pcd driver in 2.1 now contains support for playing audio
+ discs. This functionality is not available in the 2.0 version.
+
 *************************************************************************
 
 1. Introduction
@@ -61,8 +64,8 @@
         SyQuest EZ-135, EZ-230 & SparQ drives
         Avatar Shark
         Imation Superdisk LS-120
- FreeCom Power CD
- Hewlett-Packard 5GB tape drive
+ FreeCom Power CD
+ Hewlett-Packard 5GB and 8GB tape drives
         Hewlett-Packard 7100 and 7200 CD-RW drives
 
 as well as most of the clone and no-name products on the market.
@@ -71,7 +74,7 @@
 subsystem, is actually structured in three parts. There is a base
 paride module which provides a registry and some common methods for
 accessing the parallel ports. The second component is a set of
-high-level drivers for each of the different type of supported device:
+high-level drivers for each of the different types of supported devices:
 
         pd IDE disk
         pcd ATAPI CD-ROM
@@ -184,7 +187,7 @@
 is the parallel port base address, the 0 is the protocol registration
 number and 36 is the chain ID.
 
-This (2.0.34) version of PARIDE does not support chained devices on the
+This special version of PARIDE does not support chained devices on the
 same parallel port.
 
 2.2 Loading and configuring PARIDE as modules
@@ -193,7 +196,7 @@
 if you use them as loadable kernel modules.
 
 Note: using these drivers with the "kerneld" automatic module loading
-system is not recommended, and is not documented here.
+system is not recommended for beginners, and is not documented here.
 
 To use PARIDE, you must begin by
 
@@ -303,13 +306,56 @@
         mkdosfs /dev/pf0
         mount /dev/pf0 /mnt
 
-2.4 Using the pg driver
+
+2.4 The pf driver
+
+The pf driver is intended for use with parallel port ATAPI disk
+devices. The most common devices in this category are PD drives
+and LS-120 drives. Traditionally, media for these devices are not
+partitioned. Consequently, the pf driver does not support partitioned
+media. This may be changed in a future version of the driver.
+
+
+2.5 Using the pt driver
+
+The pt driver for parallel port ATAPI tape drives is a minimal driver.
+It does not yet support many of the standard tape ioctl operations.
+For best performance, a block size of 32KB should be used. You will
+probably want to set the parallel port delay to 0, if you can.
+
+
+2.6 Using the pg driver
 
 The pg driver can be used in conjunction with the cdrecord program
-to create CD-ROMs. For more information, and the required patches
-to cdrecord, please visit http://www.torque.net/parport/cdr.html .
+to create CD-ROMs. Please get cdrecord version 1.6.1a3 or later
+from ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ (you may have to look
+in the alpha subdirectory). To record CD-R media your parallel port
+should ideally be set to EPP mode, and the "port delay" should be
+set to 0. With those settings it is possible to record at 2x speed
+without any buffer underruns. If you cannot get the driver to work
+in EPP mode, try to use "bidirectional" or "PS/2" mode and 1x speeds only.
+
 
 3. Troubleshooting
+
+The most common problems that people report with the PARIDE drivers
+concern the parallel port CMOS settings. At this time, none of the
+PARIDE protocol modules support ECP mode, or any ECP combination modes.
+If you are able to do so, please set your parallel port into EPP mode
+using your CMOS setup procedure.
+
+Some parallel ports cannot reliably transfer data at full speed. To
+offset the errors, the PARIDE protocol modules introduce a "port
+delay" between each access to the i/o ports. Each protocol sets
+a default value for this delay. In most cases, the user can override
+the default and set it to 0 - resulting in somewhat higher transfer
+rates. In some rare cases (especially with older 486 systems) the
+default delays are not long enough. if you experience corrupt data
+transfers, or unexpected failures, you may wish to increase the
+port delay. The delay can be programmed using the "driveN" parameters
+to each of the high-level drivers. Please see the notes above, or
+read the comments at the beginning of the driver source files in
+linux/drivers/block/paride.
 
 While a lot of testing has gone into these drivers to make them work
 as smoothly as possible, problems will arise. If you do have problems,
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/Makefile linux/drivers/block/paride/Makefile
--- /scratch/linux-2.0.35.ref/drivers/block/paride/Makefile Wed Jul 29 20:22:10 1998
+++ linux/drivers/block/paride/Makefile Sun Aug 30 16:26:45 1998
@@ -12,6 +12,7 @@
 MOD_SUB_DIRS := $(SUB_DIRS)
 ALL_SUB_DIRS := $(SUB_DIRS)
 
+MOD_LIST_NAME := PARIDE_MODULES
 L_TARGET := paride.a
 MX_OBJS :=
 LX_OBJS :=
@@ -30,7 +31,7 @@
   LX_OBJS += pd.o
 else
   ifeq ($(CONFIG_PARIDE_PD),m)
- MX_OBJS += pd.o
+ M_OBJS += pd.o
   endif
 endif
 
@@ -38,7 +39,7 @@
   LX_OBJS += pcd.o
 else
   ifeq ($(CONFIG_PARIDE_PCD),m)
- MX_OBJS += pcd.o
+ M_OBJS += pcd.o
   endif
 endif
 
@@ -46,7 +47,7 @@
   LX_OBJS += pf.o
 else
   ifeq ($(CONFIG_PARIDE_PF),m)
- MX_OBJS += pf.o
+ M_OBJS += pf.o
   endif
 endif
 
@@ -54,7 +55,7 @@
   LX_OBJS += pt.o
 else
   ifeq ($(CONFIG_PARIDE_PT),m)
- MX_OBJS += pt.o
+ M_OBJS += pt.o
   endif
 endif
 
@@ -62,7 +63,7 @@
   LX_OBJS += pg.o
 else
   ifeq ($(CONFIG_PARIDE_PG),m)
- MX_OBJS += pg.o
+ M_OBJS += pg.o
   endif
 endif
 
@@ -70,7 +71,7 @@
   LX_OBJS += aten.o
 else
   ifeq ($(CONFIG_PARIDE_ATEN),m)
- MX_OBJS += aten.o
+ M_OBJS += aten.o
   endif
 endif
 
@@ -78,7 +79,7 @@
   LX_OBJS += bpck.o
 else
   ifeq ($(CONFIG_PARIDE_BPCK),m)
- MX_OBJS += bpck.o
+ M_OBJS += bpck.o
   endif
 endif
 
@@ -86,7 +87,7 @@
   LX_OBJS += comm.o
 else
   ifeq ($(CONFIG_PARIDE_COMM),m)
- MX_OBJS += comm.o
+ M_OBJS += comm.o
   endif
 endif
 
@@ -94,7 +95,7 @@
   LX_OBJS += dstr.o
 else
   ifeq ($(CONFIG_PARIDE_DSTR),m)
- MX_OBJS += dstr.o
+ M_OBJS += dstr.o
   endif
 endif
 
@@ -102,7 +103,7 @@
   LX_OBJS += kbic.o
 else
   ifeq ($(CONFIG_PARIDE_KBIC),m)
- MX_OBJS += kbic.o
+ M_OBJS += kbic.o
   endif
 endif
 
@@ -110,7 +111,7 @@
   LX_OBJS += epat.o
 else
   ifeq ($(CONFIG_PARIDE_EPAT),m)
- MX_OBJS += epat.o
+ M_OBJS += epat.o
   endif
 endif
 
@@ -118,7 +119,7 @@
   LX_OBJS += epia.o
 else
   ifeq ($(CONFIG_PARIDE_EPIA),m)
- MX_OBJS += epia.o
+ M_OBJS += epia.o
   endif
 endif
 
@@ -126,7 +127,7 @@
   LX_OBJS += fit2.o
 else
   ifeq ($(CONFIG_PARIDE_FIT2),m)
- MX_OBJS += fit2.o
+ M_OBJS += fit2.o
   endif
 endif
 
@@ -134,7 +135,7 @@
   LX_OBJS += fit3.o
 else
   ifeq ($(CONFIG_PARIDE_FIT3),m)
- MX_OBJS += fit3.o
+ M_OBJS += fit3.o
   endif
 endif
 
@@ -142,7 +143,7 @@
   LX_OBJS += frpw.o
 else
   ifeq ($(CONFIG_PARIDE_FRPW),m)
- MX_OBJS += frpw.o
+ M_OBJS += frpw.o
   endif
 endif
 
@@ -150,7 +151,7 @@
   LX_OBJS += on20.o
 else
   ifeq ($(CONFIG_PARIDE_ON20),m)
- MX_OBJS += on20.o
+ M_OBJS += on20.o
   endif
 endif
 
@@ -158,7 +159,7 @@
   LX_OBJS += on26.o
 else
   ifeq ($(CONFIG_PARIDE_ON26),m)
- MX_OBJS += on26.o
+ M_OBJS += on26.o
   endif
 endif
 
@@ -166,7 +167,7 @@
   LX_OBJS += ktti.o
 else
   ifeq ($(CONFIG_PARIDE_KTTI),m)
- MX_OBJS += ktti.o
+ M_OBJS += ktti.o
   endif
 endif
 
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/bpck.c linux/drivers/block/paride/bpck.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/bpck.c Wed Jul 29 20:22:10 1998
+++ linux/drivers/block/paride/bpck.c Sun Aug 30 16:20:04 1998
@@ -10,10 +10,11 @@
 /* Changes:
 
         1.01 GRG 1998.05.05 init_proto, release_proto, pi->delay
+ 1.02 GRG 1998.08.15 default pi->delay returned to 4
 
 */
 
-#define BPCK_VERSION "1.01"
+#define BPCK_VERSION "1.02"
 
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -450,7 +451,7 @@
 { MOD_DEC_USE_COUNT;
 }
 
-struct pi_protocol bpck = { "bpck",0,5,2,1,256,
+struct pi_protocol bpck = { "bpck",0,5,2,4,256,
                           bpck_write_regr,
                           bpck_read_regr,
                           bpck_write_block,
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/frpw.c linux/drivers/block/paride/frpw.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/frpw.c Wed Jul 29 20:22:10 1998
+++ linux/drivers/block/paride/frpw.c Thu Sep 24 13:33:29 1998
@@ -12,10 +12,11 @@
         1.01 GRG 1998.05.06 init_proto, release_proto
                                fix chip detect
                                added EPP-16 and EPP-32
+ 1.02 GRG 1998.09.23 added hard reset to initialisation process
 
 */
 
-#define FRPW_VERSION "1.01"
+#define FRPW_VERSION "1.02"
 
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -183,6 +184,9 @@
 /* returns chip_type: 0 = Xilinx, 1 = ASIC */
 
 { int olddelay, a, b;
+
+ w0(0); w2(8); udelay(50); w2(0xc); /* parallel bus reset */
+ udelay(1500000);
 
         olddelay = pi->delay;
         pi->delay = 10;
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/jumbo linux/drivers/block/paride/jumbo
--- /scratch/linux-2.0.35.ref/drivers/block/paride/jumbo Wed Dec 31 19:00:00 1969
+++ linux/drivers/block/paride/jumbo Thu Sep 24 17:02:25 1998
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# This script can be used to build "jumbo" modules that contain the
+# base PARIDE support, one protocol module and one high-level driver.
+#
+echo -n "High level driver [pcd] : "
+read X
+HLD=${X:-pcd}
+#
+echo -n "Protocol module [bpck] : "
+read X
+PROTO=${X:-bpck}
+#
+echo -n "Use MODVERSIONS [y] ? "
+read X
+UMODV=${X:-y}
+#
+echo -n "For SMP kernel [n] ? "
+read X
+USMP=${X:-n}
+#
+echo -n "Support PARPORT [n] ? "
+read X
+UPARP=${X:-n}
+#
+echo
+#
+case $USMP in
+ y* | Y* ) FSMP="-D__SMP__"
+ ;;
+ *) FSMP=""
+ ;;
+esac
+#
+MODI="-include ../../../include/linux/modversions.h"
+#
+case $UMODV in
+ y* | Y* ) FMODV="-DMODVERSIONS $MODI"
+ ;;
+ *) FMODV=""
+ ;;
+esac
+#
+case $UPARP in
+ y* | Y* ) FPARP="-DCONFIG_PARPORT"
+ ;;
+ *) FPARP=""
+ ;;
+esac
+#
+TARG=$HLD-$PROTO.o
+FPROTO=-DCONFIG_PARIDE_`echo "$PROTO" | tr [a-z] [A-Z]`
+FK="-D__KERNEL__ -I ../../../include"
+FLCH=-D_LINUX_CONFIG_H
+#
+echo cc $FK $FSMP $FLCH $FPARP $FPROTO -Wall -O2 -o Jb.o -c paride.c
+cc $FK $FSMP $FLCH $FPARP $FPROTO -Wall -O2 -o Jb.o -c paride.c
+#
+echo cc $FK $FSMP -Wall -O2 -o Jp.o -c $PROTO.c
+cc $FK $FSMP -Wall -O2 -o Jp.o -c $PROTO.c
+#
+echo cc $FK $FSMP $FMODV -DMODULE -DPARIDE_JUMBO -Wall -O2 -o Jd.o -c $HLD.c
+cc $FK $FSMP $FMODV -DMODULE -DPARIDE_JUMBO -Wall -O2 -o Jd.o -c $HLD.c
+#
+echo ld -r -o $TARG Jp.o Jb.o Jd.o
+ld -r -o $TARG Jp.o Jb.o Jd.o
+#
+#
+rm Jp.o Jb.o Jd.o
+#
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/on26.c linux/drivers/block/paride/on26.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/on26.c Wed Jul 29 20:22:11 1998
+++ linux/drivers/block/paride/on26.c Thu Sep 24 13:05:58 1998
@@ -10,10 +10,11 @@
 /* Changes:
 
         1.01 GRG 1998.05.06 init_proto, release_proto
+ 1.02 GRG 1998.09.23 updates for the -E rev chip
 
 */
 
-#define ON26_VERSION "1.01"
+#define ON26_VERSION "1.02"
 
 #include <linux/module.h>
 #include <linux/delay.h>
@@ -91,8 +92,8 @@
         }
 }
 
-#define CCP(x) w0(0xff);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
- w0(0x87);w0(0x78);w0(x);w2(4);
+#define CCP(x) w0(0xfe);w0(0xaa);w0(0x55);w0(0);w0(0xff);\
+ w0(0x87);w0(0x78);w0(x);w2(4);w2(5);w2(4);w0(0xff);
 
 static void on26_connect ( PIA *pi )
 
@@ -102,7 +103,6 @@
         pi->saved_r2 = r2();
 
         CCP(0x20);
- w2(0xcd); w2(0xcc); w0(0xff);
         x = 8; if (pi->mode) x = 9;
 
         w0(2); P1; w0(8); P2;
@@ -114,11 +114,62 @@
 { if (pi->mode >= 2) { w3(4); w3(4); w3(4); w3(4); }
                       else { w0(4); P1; w0(4); P1; }
         CCP(0x30);
- w2(0xcd); w2(0xcc); w0(0xff);
         w0(pi->saved_r0);
         w2(pi->saved_r2);
 }
 
+static int on26_test_port( PIA *pi) /* hard reset */
+
+{ int i, m, d;
+
+ pi->saved_r0 = r0();
+ pi->saved_r2 = r2();
+
+ d = pi->delay;
+ m = pi->mode;
+ pi->delay = 5;
+ pi->mode = 0;
+
+ w2(0xc);
+
+ CCP(0x30); CCP(0);
+
+ w0(0xfe);w0(0xaa);w0(0x55);w0(0);w0(0xff);
+ i = ((r1() & 0xf0) << 4); w0(0x87);
+ i |= (r1() & 0xf0); w0(0x78);
+ w0(0x20);w2(4);w2(5);
+ i |= ((r1() & 0xf0) >> 4);
+ w2(4);w0(0xff);
+
+ if (i == 0xb5f) {
+
+ w0(2); P1; w0(0); P2;
+ w0(3); P1; w0(0); P2;
+ w0(2); P1; w0(8); P2; udelay(100);
+ w0(2); P1; w0(0xa); P2; udelay(100);
+ w0(2); P1; w0(8); P2; udelay(1000);
+
+ on26_write_regr(pi,0,6,0xa0);
+
+ for (i=0;i<100;i++) {
+ if (!(on26_read_regr(pi,0,7) & 0x80)) break;
+ udelay(100000);
+ }
+
+ w0(4); P1; w0(4); P1;
+ }
+
+ CCP(0x30);
+
+ pi->delay = d;
+ pi->mode = m;
+ w0(pi->saved_r0);
+ w2(pi->saved_r2);
+
+ return 5;
+}
+
+
 static void on26_read_block( PIA *pi, char * buf, int count )
 
 { int k, a, b;
@@ -240,7 +291,7 @@
                            on26_read_block,
                            on26_connect,
                            on26_disconnect,
- 0,
+ on26_test_port,
                            0,
                            0,
                            on26_log_adapter,
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/pcd.c linux/drivers/block/paride/pcd.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/pcd.c Wed Jul 29 20:22:11 1998
+++ linux/drivers/block/paride/pcd.c Thu Sep 24 13:22:31 1998
@@ -65,10 +65,11 @@
                         (default "pcd")
 
             verbose This parameter controls the amount of logging
- that is done while the driver probes for
- devices. Set it to 0 for a quiet load, or 1 to
- see all the progress messages. (default 0)
-
+ that the driver will do. Set it to 0 for
+ normal operation, 1 to see autoprobe progress
+ messages, or 2 to see additional debugging
+ output. (default 0)
+
             nice This parameter controls the driver's use of
                         idle CPU time, at the expense of some speed.
  
@@ -95,10 +96,13 @@
                                 standard for clearing error status.
                                 Use spinlocks. Eliminate sti().
         1.03 GRG 1998.06.16 Eliminated an Ugh
+ 1.04 GRG 1998.08.15 Added extra debugging, improvements to
+ pcd_completion, use HZ in loop timing
+ 1.05s GRG 1998.09.24 Added jumbo support, adjust reset timeout
 
 */
 
-#define PCD_VERSION "1.03s"
+#define PCD_VERSION "1.05s"
 #define PCD_MAJOR 46
 #define PCD_NAME "pcd"
 #define PCD_UNITS 4
@@ -180,9 +184,9 @@
 #define PCD_RETRIES 5
 #define PCD_TMO 800 /* timeout in jiffies */
 #define PCD_DELAY 50 /* spin delay in uS */
-#define PCD_READY_TMO 20
+#define PCD_READY_TMO 20 /* in seconds */
 
-#define PCD_SPIN (10000/PCD_DELAY)*PCD_TMO
+#define PCD_SPIN (1000000*PCD_TMO)/(HZ*PCD_DELAY)
 
 #define IDE_ERR 0x01
 #define IDE_DRQ 0x08
@@ -246,6 +250,8 @@
 static int pcd_count; /* number of blocks still to do */
 static char * pcd_buf; /* buffer for request in progress */
 
+static int pcd_warned = 0; /* Have we logged a phase warning ? */
+
 /* kernel glue structures */
 
 static struct file_operations pcd_fops = {
@@ -405,6 +411,12 @@
 
 { int err;
 
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
         err = pcd_init();
 
         return err;
@@ -479,23 +491,51 @@
 
 static int pcd_completion( int unit, char * buf, char * fun )
 
-{ int r, s, n;
+{ int r, d, p, n, k, j;
 
- r = pcd_wait(unit,IDE_BUSY,IDE_DRQ|IDE_READY|IDE_ERR,fun,"completion");
+ r = -1; k = 0; j = 0;
 
- if ((RR(0,2)&2) && (RR(0,7)&IDE_DRQ)) {
- n = (((RR(0,4)+256*RR(0,5))+3)&0xfffc);
- pi_read_block(PI,buf,n);
+ if (!pcd_wait(unit,IDE_BUSY,IDE_DRQ|IDE_READY|IDE_ERR,
+ fun,"completion")) {
+ r = 0;
+ while (RR(0,7)&IDE_DRQ) {
+ d = (RR(0,4)+256*RR(0,5));
+ n = ((d+3)&0xfffc);
+ p = RR(0,2)&3;
+
+ if ((p == 2) && (n > 0) && (j == 0)) {
+ pi_read_block(PI,buf,n);
+ if (verbose > 1)
+ printk("%s: %s: Read %d bytes\n",PCD.name,fun,n);
+ r = 0; j++;
+ } else {
+ if (verbose > 1)
+ printk("%s: %s: Unexpected phase %d, d=%d, k=%d\n",
+ PCD.name,fun,p,d,k);
+ if ((verbose < 2) && !pcd_warned) {
+ pcd_warned = 1;
+ printk("%s: WARNING: ATAPI phase errors\n",PCD.name);
+ }
+ udelay(1000);
+ }
+ if (k++ > PCD_TMO) {
+ printk("%s: Stuck DRQ\n",PCD.name);
+ break;
+ }
+ if (pcd_wait(unit,IDE_BUSY,IDE_DRQ|IDE_READY|IDE_ERR,
+ fun,"completion")) {
+ r = -1;
+ break;
+ }
+ }
         }
-
- s = pcd_wait(unit,IDE_BUSY,IDE_READY|IDE_ERR,fun,"data done");
-
+
         pi_disconnect(PI);
 
- return (r?r:s);
+ return r;
 }
 
-static void pcd_req_sense( int unit, int quiet )
+static void pcd_req_sense( int unit, char *fun )
 
 { char rs_cmd[12] = { 0x03,0,0,0,16,0,0,0,0,0,0,0 };
         char buf[16];
@@ -507,8 +547,8 @@
 
         PCD.last_sense = -1;
         if (!r) {
- if (!quiet) printk("%s: Sense key: %x, ASC: %x, ASQ: %x\n",
- PCD.name,buf[2]&0xf,buf[12],buf[13]);
+ if (fun) printk("%s: %s: Sense key: %x, ASC: %x, ASQ: %x\n",
+ PCD.name,fun,buf[2]&0xf,buf[12],buf[13]);
             PCD.last_sense = (buf[2]&0xf) | ((buf[12]&0xff)<<8)
                                           | ((buf[13]&0xff)<<16) ;
         }
@@ -521,12 +561,12 @@
         r = pcd_command(unit,cmd,dlen,fun);
         udelay(1000);
         if (!r) r = pcd_completion(unit,buf,fun);
- if (r) pcd_req_sense(unit,!fun);
+ if (r) pcd_req_sense(unit,fun);
         
         return r;
 }
 
-#define DBMSG(msg) NULL
+#define DBMSG(msg) ((verbose>1)?(msg):NULL)
 
 static void pcd_lock(int unit)
 
@@ -558,7 +598,7 @@
         pcd_atapi(unit,ej_cmd,0,pcd_scratch,"eject");
 }
 
-#define PCD_RESET_TMO 30 /* in tenths of a second */
+#define PCD_RESET_TMO 100 /* in tenths of a second */
 
 static void pcd_sleep( int cs )
 
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/pd.c linux/drivers/block/paride/pd.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/pd.c Wed Jul 29 20:22:11 1998
+++ linux/drivers/block/paride/pd.c Thu Sep 24 13:34:36 1998
@@ -113,10 +113,12 @@
         1.02 GRG 1998.05.06 SMP spinlock changes,
                                 Added slave support
         1.03 GRG 1998.06.16 Eliminate an Ugh.
+ 1.04s GRG 1998.09.24 Added jumbo support
+ Use HZ in loop timings, extra debugging
 
 */
 
-#define PD_VERSION "1.03s"
+#define PD_VERSION "1.04s"
 #define PD_MAJOR 45
 #define PD_NAME "pd"
 #define PD_UNITS 4
@@ -218,7 +220,7 @@
 #define PD_TMO 800 /* interrupt timeout in jiffies */
 #define PD_SPIN_DEL 50 /* spin delay in micro-seconds */
 
-#define PD_SPIN (10000/PD_SPIN_DEL)*PD_TMO
+#define PD_SPIN (1000000*PD_TMO)/(HZ*PD_SPIN_DEL)
 
 #define STAT_ERR 0x00001
 #define STAT_INDEX 0x00002
@@ -595,6 +597,12 @@
 
 { int err, unit;
 
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
         err = pd_init();
         if (err) return err;
 
@@ -653,7 +661,7 @@
         udelay(250);
 }
 
-#define DBMSG(msg) NULL
+#define DBMSG(msg) ((verbose>1)?(msg):NULL)
 
 static int pd_wait_for( int unit, int w, char * msg ) /* polled wait */
 
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/pf.c linux/drivers/block/paride/pf.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/pf.c Wed Jul 29 20:22:11 1998
+++ linux/drivers/block/paride/pf.c Thu Sep 24 13:35:45 1998
@@ -111,10 +111,12 @@
                                 Small change in pf_completion to round
                                 up transfer size.
         1.02 GRG 1998.06.16 Eliminated an Ugh
+ 1.03s GRG 1998.09.24 Added jumbo support
+ Use HZ in loop timings, extra debugging
 
 */
 
-#define PF_VERSION "1.02s"
+#define PF_VERSION "1.03s"
 #define PF_MAJOR 47
 #define PF_NAME "pf"
 #define PF_UNITS 4
@@ -211,7 +213,7 @@
 #define PF_TMO 800 /* interrupt timeout in jiffies */
 #define PF_SPIN_DEL 50 /* spin delay in micro-seconds */
 
-#define PF_SPIN (10000/PF_SPIN_DEL)*PF_TMO
+#define PF_SPIN (1000000*PF_TMO)/(HZ*PF_SPIN_DEL)
 
 #define STAT_ERR 0x00001
 #define STAT_INDEX 0x00002
@@ -495,6 +497,12 @@
 
 { int err;
 
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
         err = pf_init();
 
         return err;
@@ -616,7 +624,7 @@
         return r;
 }
 
-#define DBMSG(msg) NULL
+#define DBMSG(msg) ((verbose>1)?(msg):NULL)
 
 static void pf_lock(int unit, int func)
 
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/pg.c linux/drivers/block/paride/pg.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/pg.c Wed Jul 29 20:22:11 1998
+++ linux/drivers/block/paride/pg.c Thu Sep 24 13:15:22 1998
@@ -38,10 +38,10 @@
         To use this device, you must have the following device
         special files defined:
 
- /dev/pg0 b 97 0
- /dev/pg1 b 97 1
- /dev/pg2 b 97 2
- /dev/pg3 b 97 3
+ /dev/pg0 c 97 0
+ /dev/pg1 c 97 1
+ /dev/pg2 c 97 2
+ /dev/pg3 c 97 3
 
         (You'll need to change the 97 to something else if you use
         the 'major' parameter to install the driver on a different
@@ -121,9 +121,11 @@
 /* Changes:
 
         1.01 GRG 1998.06.16 Bug fixes
+ 1.02 GRG 1998.09.24 Added jumbo support
+
 */
 
-#define PG_VERSION "1.01s"
+#define PG_VERSION "1.02s"
 #define PG_MAJOR 97
 #define PG_NAME "pg"
 #define PG_UNITS 4
@@ -318,6 +320,12 @@
 int init_module(void)
 
 { int err;
+
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
 
         err = pg_init();
 
diff -urN /scratch/linux-2.0.35.ref/drivers/block/paride/pt.c linux/drivers/block/paride/pt.c
--- /scratch/linux-2.0.35.ref/drivers/block/paride/pt.c Wed Jul 29 20:22:11 1998
+++ linux/drivers/block/paride/pt.c Thu Sep 24 13:14:17 1998
@@ -74,10 +74,11 @@
                         (default "pt").
 
             verbose This parameter controls the amount of logging
- that is done while the driver probes for
- devices. Set it to 0 for a quiet load, or 1 to
- see all the progress messages. (default 0)
-
+ that the driver will do. Set it to 0 for
+ normal operation, 1 to see autoprobe progress
+ messages, or 2 to see additional debugging
+ output. (default 0)
+
         If this driver is built into the kernel, you can use
         the following command line parameters, with the same values
         as the corresponding module parameters listed above:
@@ -99,10 +100,13 @@
                                 for clearing error status.
                                 Eliminate sti();
         1.02 GRG 1998.06.16 Eliminate an Ugh.
-
+ 1.03 GRG 1998.08.15 Adjusted PT_TMO, use HZ in loop timing,
+ extra debugging
+ 1.04 GRG 1998.09.24 Repair minor coding error, added jumbo support
+
 */
 
-#define PT_VERSION "1.02s"
+#define PT_VERSION "1.04s"
 #define PT_MAJOR 96
 #define PT_NAME "pt"
 #define PT_UNITS 4
@@ -168,13 +172,13 @@
 #include "paride.h"
 
 #define PT_MAX_RETRIES 5
-#define PT_TMO 800 /* interrupt timeout in jiffies */
+#define PT_TMO 3000 /* interrupt timeout in jiffies */
 #define PT_SPIN_DEL 50 /* spin delay in micro-seconds */
-#define PT_RESET_TMO 30 /* 3 seconds */
+#define PT_RESET_TMO 30 /* 30 seconds */
 #define PT_READY_TMO 60 /* 60 seconds */
 #define PT_REWIND_TMO 1200 /* 20 minutes */
 
-#define PT_SPIN (10000/PT_SPIN_DEL)*PT_TMO
+#define PT_SPIN ((1000000/(HZ*PT_SPIN_DEL))*PT_TMO)
 
 #define STAT_ERR 0x00001
 #define STAT_INDEX 0x00002
@@ -317,6 +321,12 @@
 
 { int err;
 
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
         err = pt_init();
 
         return err;
@@ -498,7 +508,7 @@
         pt_media_access_cmd(unit,PT_TMO,wm_cmd,"write filemark");
 }
 
-#define DBMSG(msg) NULL
+#define DBMSG(msg) ((verbose>1)?(msg):NULL)
 
 static int pt_reset( int unit )
 
@@ -573,8 +583,8 @@
         char *ms[2] = {"master","slave"};
         char mf[10], id[18];
         char id_cmd[12] = { ATAPI_IDENTIFY,0,0,0,36,0,0,0,0,0,0,0};
- char ms_cmd[12] = { ATAPI_MODE_SENSE,0,0x2a,0,128,0,0,0,0,0,0,0};
- char ls_cmd[12] = { ATAPI_LOG_SENSE,0,0x71,0,0,0,0,0,128,0,0,0};
+ char ms_cmd[12] = { ATAPI_MODE_SENSE,0,0x2a,0,36,0,0,0,0,0,0,0};
+ char ls_cmd[12] = { ATAPI_LOG_SENSE,0,0x71,0,0,0,0,0,36,0,0,0};
         char buf[36];
 
         s = pt_atapi(unit,id_cmd,36,buf,"identify");

--------------------------------------------------------------------------
Grant R. Guenther grant@torque.net
--------------------------------------------------------------------------

-- To unsubscribe, send mail to: linux-parport-request@torque.net --
-- with the single word "unsubscribe" in the body of the message. --



This archive was generated by hypermail 2.0b3 on Wed 30 Dec 1998 - 10:18:22 EST