[PARPORT] [PATCH] PARIDE updates to 2.1.122


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


Hi Linus

Below is a small set of patches against 2.1.122. They do:

        - fix some minor coding and documentation errors
        - corrections to two protocol modules (important)
        - expand Documentation/paride.txt
        - add support for building single-module PARIDE drivers

diff -urN /scratch/linux-2.1.122.ref/Documentation/Configure.help linux/Documentation/Configure.help
--- /scratch/linux-2.1.122.ref/Documentation/Configure.help Fri Sep 18 13:08:31 1998
+++ linux/Documentation/Configure.help Wed Sep 23 16:15:13 1998
@@ -650,9 +650,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.1.122.ref/Documentation/paride.txt linux/Documentation/paride.txt
--- /scratch/linux-2.1.122.ref/Documentation/paride.txt Sat Jun 13 15:08:19 1998
+++ linux/Documentation/paride.txt Wed Sep 23 16:10:47 1998
@@ -1,7 +1,7 @@
 
                 Linux and parallel port IDE devices
 
-PARIDE v1.02 (c) 1997-8 Grant Guenther <grant@torque.net>
+PARIDE v1.03 (c) 1997-8 Grant Guenther <grant@torque.net>
 
 1. Introduction
 
@@ -42,8 +42,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.
@@ -52,7 +52,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
@@ -176,7 +176,7 @@
 if you use them as loadable kernel modules.
 
 Note 1: 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.
 
 Note 2: if you build PARPORT support as a loadable module, PARIDE must
 also be built as loadable modules, and PARPORT must be loaded before the
@@ -290,13 +290,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.1.122.ref/drivers/block/paride/frpw.c linux/drivers/block/paride/frpw.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/frpw.c Thu May 14 22:11:48 1998
+++ linux/drivers/block/paride/frpw.c Wed Sep 23 18:04:51 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 */
+ mdelay(1500);
 
         olddelay = pi->delay;
         pi->delay = 10;
diff -urN /scratch/linux-2.1.122.ref/drivers/block/paride/jumbo linux/drivers/block/paride/jumbo
--- /scratch/linux-2.1.122.ref/drivers/block/paride/jumbo Wed Dec 31 19:00:00 1969
+++ linux/drivers/block/paride/jumbo Thu Sep 24 16:52:04 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.1.122.ref/drivers/block/paride/on26.c linux/drivers/block/paride/on26.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/on26.c Thu May 14 22:11:48 1998
+++ linux/drivers/block/paride/on26.c Wed Sep 23 17:59:02 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.1.122.ref/drivers/block/paride/pcd.c linux/drivers/block/paride/pcd.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/pcd.c Thu Aug 20 18:17:05 1998
+++ linux/drivers/block/paride/pcd.c Thu Sep 24 12:38:32 1998
@@ -96,10 +96,11 @@
                                 pcd_completion, use HZ in loop timing
         1.05 GRG 1998.08.16 Conformed to "Uniform CD-ROM" standard
         1.06 GRG 1998.08.19 Added audio ioctl support
+ 1.07 GRG 1998.09.24 Increased reset timeout, added jumbo support
 
 */
 
-#define PCD_VERSION "1.06"
+#define PCD_VERSION "1.07"
 #define PCD_MAJOR 46
 #define PCD_NAME "pcd"
 #define PCD_UNITS 4
@@ -191,7 +192,7 @@
 #define PCD_TMO 800 /* timeout in jiffies */
 #define PCD_DELAY 50 /* spin delay in uS */
 #define PCD_READY_TMO 20 /* in seconds */
-#define PCD_RESET_TMO 30 /* in tenths of a second */
+#define PCD_RESET_TMO 100 /* in tenths of a second */
 
 #define PCD_SPIN (1000000*PCD_TMO)/(HZ*PCD_DELAY)
 
@@ -364,6 +365,12 @@
 int init_module(void)
 
 { int err;
+
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
 
         err = pcd_init();
 
diff -urN /scratch/linux-2.1.122.ref/drivers/block/paride/pd.c linux/drivers/block/paride/pd.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/pd.c Mon Aug 24 16:14:10 1998
+++ linux/drivers/block/paride/pd.c Thu Sep 24 12:40:26 1998
@@ -110,10 +110,11 @@
                                 Added slave support
         1.03 GRG 1998.06.16 Eliminate an Ugh.
         1.04 GRG 1998.08.15 Extra debugging, use HZ in loop timing
+ 1.05 GRG 1998.09.24 Added jumbo support
 
 */
 
-#define PD_VERSION "1.04"
+#define PD_VERSION "1.05"
 #define PD_MAJOR 45
 #define PD_NAME "pd"
 #define PD_UNITS 4
@@ -610,6 +611,12 @@
 int init_module(void)
 
 { int err, unit;
+
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
 
         err = pd_init();
         if (err) return err;
diff -urN /scratch/linux-2.1.122.ref/drivers/block/paride/pf.c linux/drivers/block/paride/pf.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/pf.c Mon Aug 24 16:14:10 1998
+++ linux/drivers/block/paride/pf.c Thu Sep 24 12:41:12 1998
@@ -109,10 +109,11 @@
                                 up transfer size.
         1.02 GRG 1998.06.16 Eliminated an Ugh
         1.03 GRG 1998.08.16 Use HZ in loop timings, extra debugging
+ 1.04 GRG 1998.09.24 Added jumbo support
 
 */
 
-#define PF_VERSION "1.03"
+#define PF_VERSION "1.04"
 #define PF_MAJOR 47
 #define PF_NAME "pf"
 #define PF_UNITS 4
@@ -508,6 +509,12 @@
 int init_module(void)
 
 { int err;
+
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
 
         err = pf_init();
 
diff -urN /scratch/linux-2.1.122.ref/drivers/block/paride/pg.c linux/drivers/block/paride/pg.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/pg.c Mon Aug 24 16:46:50 1998
+++ linux/drivers/block/paride/pg.c Thu Sep 24 12:44:27 1998
@@ -34,10 +34,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
@@ -117,9 +117,11 @@
 /* Changes:
 
         1.01 GRG 1998.06.16 Bug fixes
+ 1.02 GRG 1998.09.24 Added jumbo support
+
 */
 
-#define PG_VERSION "1.01"
+#define PG_VERSION "1.02"
 #define PG_MAJOR 97
 #define PG_NAME "pg"
 #define PG_UNITS 4
@@ -323,6 +325,12 @@
 int init_module(void)
 
 { int err;
+
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
 
         err = pg_init();
 
diff -urN /scratch/linux-2.1.122.ref/drivers/block/paride/pt.c linux/drivers/block/paride/pt.c
--- /scratch/linux-2.1.122.ref/drivers/block/paride/pt.c Mon Aug 24 16:14:10 1998
+++ linux/drivers/block/paride/pt.c Thu Sep 24 12:43:24 1998
@@ -100,10 +100,11 @@
         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.03"
+#define PT_VERSION "1.04"
 #define PT_MAJOR 96
 #define PT_NAME "pt"
 #define PT_UNITS 4
@@ -328,6 +329,12 @@
 
 { int err;
 
+#ifdef PARIDE_JUMBO
+ { extern paride_init();
+ paride_init();
+ }
+#endif
+
         err = pt_init();
 
         return err;
@@ -584,8 +591,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:21 EST