Skip to contentSkip to conversation

2.5.41 s390 (7/8): 3270.

PATCH New Martin Schwidefsky 1 participant 1 message Oct 9, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 2.5.41 s390 (7/8): 3270.

Fix 3270 console reboot loop. Recognize 3270 control unit type 3174. Fix tubfs kmallocs. Dynamically get 3270 input buffer. Get bootup colors right on 3270 console

Documentation/s390/3270.ChangeLog +29 -0
diff -urN linux-2.5.41/Documentation/s390/3270.ChangeLog linux-2.5.41-s390/Documentation/s390/3270.ChangeLog
@@ -1,5 +1,34 @@
 ChangeLog for the UTS Global 3270-support patch
 
+Sep 2002:	Get bootup colors right on 3270 console
+	* In tubttybld.c, substantially revise ESC processing so that
+	  ESC sequences (especially coloring ones) and the strings
+	  they affect work as right as 3270 can get them.  Also, set
+	  screen height to omit the two rows used for input area, in
+	  tty3270_open() in tubtty.c.
+
+Sep 2002:	Dynamically get 3270 input buffer
+	* Oversize 3270 screen widths may exceed GEOM_MAXINPLEN columns,
+	  so get input-area buffer dynamically when sizing the device in
+	  tubmakemin() in tuball.c (if it's the console) or tty3270_open()
+	  in tubtty.c (if needed).  Change tubp->tty_input to be a
+	  pointer rather than an array, in tubio.h.
+
+Sep 2002:	Fix tubfs kmalloc()s
+	* Do read and write lengths correctly in fs3270_read()
+	  and fs3270_write(), whilst never asking kmalloc()
+	  for more than 0x800 bytes.  Affects tubfs.c and tubio.h.
+
+Sep 2002:	Recognize 3270 control unit type 3174
+	* Recognize control-unit type 0x3174 as well as 0x327?.
+	  The IBM 2047 device emulates a 3174 control unit.
+	  Modularize control-unit recognition in tuball.c by
+	  adding and invoking new tub3270_is_ours().
+
+Apr 2002:	Fix 3270 console reboot loop
+	* (Belated log entry) Fixed reboot loop if 3270 console,
+	  in tubtty.c:ttu3270_bh().
+
 Feb 6, 2001:
 	* This changelog is new
 	* tub3270 now supports 3270 console:
drivers/s390/char/tuball.c +15 -1
diff -urN linux-2.5.41/drivers/s390/char/tuball.c linux-2.5.41-s390/drivers/s390/char/tuball.c
@@ -228,6 +228,16 @@
 	MOD_DEC_USE_COUNT;
 }
 
+static int
+tub3270_is_ours(s390_dev_info_t *dp)
+{
+	if ((dp->sid_data.cu_type & 0xfff0) == 0x3270)
+		return 1;
+	if (dp->sid_data.cu_type == 0x3174)
+		return 1;
+	return 0;
+}
+
 /*
  * tub3270_init() called by kernel or module initialization
  */
@@ -283,7 +293,7 @@
 		}
 #endif /* LINUX_VERSION_CODE */
 #endif /* CONFIG_TN3270_CONSOLE */
-		if ((d.sid_data.cu_type & 0xfff0) != 0x3270)
+		if (!tub3270_is_ours(&d))
 			continue;
 
 		rc = tubmakemin(i, &d);
@@ -498,6 +508,10 @@
 			tty3270_rcl_fini(tubp);
 			kfree(tubp->tty_bcb.bc_buf);
 			tubp->tty_bcb.bc_buf = NULL;
+			if (tubp->tty_input) {
+				kfree(tubp->tty_input);
+				tubp->tty_input = NULL;
+			}
 			tubp->ttyscreen = NULL;
 			kfree(tubp);
 			*tubpp = NULL;
drivers/s390/char/tubfs.c +99 -33

200 lines not on this page · raw message

drivers/s390/char/tubio.h +11 -2
diff -urN linux-2.5.41/drivers/s390/char/tubio.h linux-2.5.41-s390/drivers/s390/char/tubio.h
@@ -27,6 +27,7 @@
 #include <linux/slab.h>
 #include <asm/irq.h>
 #include <asm/io.h>
+#include <asm/idals.h>
 #include <linux/console.h>
 #include <linux/interrupt.h>
 #include <asm/ebcdic.h>
@@ -81,10 +82,17 @@
 #define TAT_CHARS 0x43
 #define TAT_TRANS 0x46
 
+/* Extended-Highlighting Bytes */
+#define TAX_RESET 0x00
+#define TAX_BLINK 0xf1
+#define TAX_REVER 0xf2
+#define TAX_UNDER 0xf4
+
 /* Reset value */
 #define TAR_RESET 0x00
 
 /* Color values */
+#define TAC_RESET 0x00
 #define TAC_BLUE 0xf1
 #define TAC_RED 0xf2
 #define TAC_PINK 0xf3
@@ -220,7 +228,7 @@
 	devstat_t       devstat;
 	ccw1_t          rccw;
 	ccw1_t          wccw;
-	void            *wbuf;
+	addr_t		*wbuf;
 	int             cswl;
 	void            (*intv)(struct tub_s *, devstat_t *);
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
@@ -242,12 +250,13 @@
 
 	/* Stuff for tty-driver support */
 	struct tty_struct *tty;
-	char tty_input[GEOM_MAXINPLEN]; /* tty input area */
+	char *tty_input;		/* tty input area */
 	int tty_inattr;         	/* input-area field attribute */
 #define TTY_OUTPUT_SIZE 1024
 	bcb_t tty_bcb;			/* Output buffer control info */
 	int tty_oucol;                  /* Kludge */
 	int tty_nextlogx;               /* next screen-log position */
+	int tty_savecursor;		/* saved cursor position */
 	int tty_scrolltime;             /* scrollforward wait time, sec */
 	struct timer_list tty_stimer;   /* timer for scrolltime */
 	aid_t tty_aid[64];              /* Aid descriptors */
drivers/s390/char/tubtty.c +8 -3
diff -urN linux-2.5.41/drivers/s390/char/tubtty.c linux-2.5.41-s390/drivers/s390/char/tubtty.c
@@ -216,8 +216,10 @@
 	tubp->tty = tty;
 	tubp->lnopen = 1;
 	tty->driver_data = tubp;
-	tty->winsize.ws_row = tubp->geom_rows;
+	tty->winsize.ws_row = tubp->geom_rows - 2;
 	tty->winsize.ws_col = tubp->geom_cols;
+	if (tubp->tty_input == NULL)
+		tubp->tty_input = kmalloc(GEOM_INPLEN, GFP_KERNEL|GFP_DMA);
 	tubp->tty_inattr = TF_INPUT;
 	tubp->cmd = cmd;
 	tty3270_build(tubp);
@@ -801,7 +803,9 @@
 static void
 tty3270_start_input(tub_t *tubp)
 {
-	tubp->ttyccw.cda = virt_to_phys(&tubp->tty_input);
+	if (tubp->tty_input == NULL)
+		return;
+	tubp->ttyccw.cda = virt_to_phys(tubp->tty_input);
 	tubp->ttyccw.cmd_code = TC_READMOD;
 	tubp->ttyccw.count = GEOM_INPLEN;
 	tubp->ttyccw.flags = CCW_FLAG_SLI;
@@ -818,7 +822,8 @@
 	char *aidstring;
 
 	count = GEOM_INPLEN - tubp->cswl;
-	in = tubp->tty_input;
+	if ((in = tubp->tty_input) == NULL)
+		goto do_build;
 	tty3270_aid_get(tubp, in[0], &aidflags, &aidstring);
 
 	if (aidflags & TA_CLEARKEY) {
drivers/s390/char/tubttybld.c +227 -94

440 lines not on this page · raw message