2 * drivers/s390/char/sclp_vt220.c
3 * SCLP VT220 terminal driver.
6 * Copyright (C) 2003 IBM Deutschland Entwicklung GmbH, IBM Corporation
7 * Author(s): Peter Oberparleiter <Peter.Oberparleiter@de.ibm.com>
10 #include <linux/config.h>
11 #include <linux/module.h>
12 #include <linux/spinlock.h>
13 #include <linux/list.h>
14 #include <linux/wait.h>
15 #include <linux/timer.h>
16 #include <linux/kernel.h>
17 #include <linux/tty.h>
18 #include <linux/tty_driver.h>
19 #include <linux/sched.h>
20 #include <linux/errno.h>
22 #include <linux/major.h>
23 #include <linux/console.h>
24 #include <linux/kdev_t.h>
25 #include <linux/bootmem.h>
26 #include <linux/interrupt.h>
27 #include <linux/init.h>
28 #include <asm/uaccess.h>
31 #define SCLP_VT220_PRINT_HEADER "sclp vt220 tty driver: "
32 #define SCLP_VT220_MAJOR TTY_MAJOR
33 #define SCLP_VT220_MINOR 65
34 #define SCLP_VT220_DRIVER_NAME "sclp_vt220"
35 #define SCLP_VT220_DEVICE_NAME "ttysclp"
36 #define SCLP_VT220_CONSOLE_NAME "ttyS"
37 #define SCLP_VT220_CONSOLE_INDEX 1 /* console=ttyS1 */
38 #define SCLP_VT220_BUF_SIZE 80
40 /* Representation of a single write request */
41 struct sclp_vt220_request {
42 struct list_head list;
43 struct sclp_req sclp_req;
45 struct timer_list retry_timer;
49 struct sclp_vt220_sccb {
50 struct sccb_header header;
51 struct evbuf_header evbuf;
54 #define SCLP_VT220_MAX_CHARS_PER_BUFFER (PAGE_SIZE - \
55 sizeof(struct sclp_vt220_request) - \
56 sizeof(struct sclp_vt220_sccb))
58 /* Structures and data needed to register tty driver */
59 static struct tty_driver *sclp_vt220_driver;
61 /* The tty_struct that the kernel associated with us */
62 static struct tty_struct *sclp_vt220_tty;
64 /* Lock to protect internal data from concurrent access */
65 static spinlock_t sclp_vt220_lock;
67 /* List of empty pages to be used as write request buffers */
68 static struct list_head sclp_vt220_empty;
70 /* List of pending requests */
71 static struct list_head sclp_vt220_outqueue;
73 /* Number of requests in outqueue */
74 static int sclp_vt220_outqueue_count;
76 /* Wait queue used to delay write requests while we've run out of buffers */
77 static wait_queue_head_t sclp_vt220_waitq;
79 /* Timer used for delaying write requests to merge subsequent messages into
81 static struct timer_list sclp_vt220_timer;
83 /* Pointer to current request buffer which has been partially filled but not
85 static struct sclp_vt220_request *sclp_vt220_current_request;
87 /* Number of characters in current request buffer */
88 static int sclp_vt220_buffered_chars;
90 /* Flag indicating whether this driver has already been initialized */
91 static int sclp_vt220_initialized = 0;
93 /* Flag indicating that sclp_vt220_current_request should really
94 * have been already queued but wasn't because the SCLP was processing
96 static int sclp_vt220_flush_later;
98 static void sclp_vt220_receiver_fn(struct evbuf_header *evbuf);
99 static void __sclp_vt220_emit(struct sclp_vt220_request *request);
100 static void sclp_vt220_emit_current(void);
102 /* Registration structure for our interest in SCLP event buffers */
103 static struct sclp_register sclp_vt220_register = {
104 .send_mask = EvTyp_VT220Msg_Mask,
105 .receive_mask = EvTyp_VT220Msg_Mask,
106 .state_change_fn = NULL,
107 .receiver_fn = sclp_vt220_receiver_fn
112 * Put provided request buffer back into queue and check emit pending
113 * buffers if necessary.
116 sclp_vt220_process_queue(struct sclp_vt220_request *request)
119 struct sclp_vt220_request *next;
122 /* Put buffer back to list of empty buffers */
123 page = request->sclp_req.sccb;
124 spin_lock_irqsave(&sclp_vt220_lock, flags);
125 /* Move request from outqueue to empty queue */
126 list_del(&request->list);
127 sclp_vt220_outqueue_count--;
128 list_add_tail((struct list_head *) page, &sclp_vt220_empty);
129 /* Check if there is a pending buffer on the out queue. */
131 if (!list_empty(&sclp_vt220_outqueue))
132 next = list_entry(sclp_vt220_outqueue.next,
133 struct sclp_vt220_request, list);
134 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
136 __sclp_vt220_emit(next);
137 else if (sclp_vt220_flush_later)
138 sclp_vt220_emit_current();
139 wake_up(&sclp_vt220_waitq);
140 /* Check if the tty needs a wake up call */
141 if (sclp_vt220_tty != NULL) {
142 if ((sclp_vt220_tty->flags & (1 << TTY_DO_WRITE_WAKEUP)) &&
143 (sclp_vt220_tty->ldisc.write_wakeup != NULL))
144 (sclp_vt220_tty->ldisc.write_wakeup)(sclp_vt220_tty);
145 wake_up_interruptible(&sclp_vt220_tty->write_wait);
150 * Retry sclp write request after waiting some time for an sclp equipment
154 sclp_vt220_retry(unsigned long data)
156 struct sclp_vt220_request *request;
157 struct sclp_vt220_sccb *sccb;
159 request = (struct sclp_vt220_request *) data;
160 request->sclp_req.status = SCLP_REQ_FILLED;
161 sccb = (struct sclp_vt220_sccb *) request->sclp_req.sccb;
162 sccb->header.response_code = 0x0000;
163 sclp_add_request(&request->sclp_req);
166 #define SCLP_BUFFER_MAX_RETRY 5
167 #define SCLP_BUFFER_RETRY_INTERVAL 2
170 * Callback through which the result of a write request is reported by the
174 sclp_vt220_callback(struct sclp_req *request, void *data)
176 struct sclp_vt220_request *vt220_request;
177 struct sclp_vt220_sccb *sccb;
179 vt220_request = (struct sclp_vt220_request *) data;
180 if (request->status == SCLP_REQ_FAILED) {
181 sclp_vt220_process_queue(vt220_request);
184 sccb = (struct sclp_vt220_sccb *) vt220_request->sclp_req.sccb;
186 /* Check SCLP response code and choose suitable action */
187 switch (sccb->header.response_code) {
191 case 0x05f0: /* Target resource in improper state */
194 case 0x0340: /* Contained SCLP equipment check */
195 if (vt220_request->retry_count++ > SCLP_BUFFER_MAX_RETRY)
197 /* Remove processed buffers and requeue rest */
198 if (sclp_remove_processed((struct sccb_header *) sccb) > 0) {
199 /* Not all buffers were processed */
200 sccb->header.response_code = 0x0000;
201 vt220_request->sclp_req.status = SCLP_REQ_FILLED;
202 sclp_add_request(request);
207 case 0x0040: /* SCLP equipment check */
208 if (vt220_request->retry_count++ > SCLP_BUFFER_MAX_RETRY)
210 /* Wait some time, then retry request */
211 vt220_request->retry_timer.function = sclp_vt220_retry;
212 vt220_request->retry_timer.data =
213 (unsigned long) vt220_request;
214 vt220_request->retry_timer.expires =
215 jiffies + SCLP_BUFFER_RETRY_INTERVAL*HZ;
216 add_timer(&vt220_request->retry_timer);
222 sclp_vt220_process_queue(vt220_request);
226 * Emit vt220 request buffer to SCLP.
229 __sclp_vt220_emit(struct sclp_vt220_request *request)
231 if (!(sclp_vt220_register.sclp_send_mask & EvTyp_VT220Msg_Mask)) {
232 request->sclp_req.status = SCLP_REQ_FAILED;
233 sclp_vt220_callback(&request->sclp_req, (void *) request);
236 request->sclp_req.command = SCLP_CMDW_WRITEDATA;
237 request->sclp_req.status = SCLP_REQ_FILLED;
238 request->sclp_req.callback = sclp_vt220_callback;
239 request->sclp_req.callback_data = (void *) request;
241 sclp_add_request(&request->sclp_req);
245 * Queue and emit given request.
248 sclp_vt220_emit(struct sclp_vt220_request *request)
253 spin_lock_irqsave(&sclp_vt220_lock, flags);
254 list_add_tail(&request->list, &sclp_vt220_outqueue);
255 count = sclp_vt220_outqueue_count++;
256 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
257 /* Emit only the first buffer immediately - callback takes care of
260 __sclp_vt220_emit(request);
264 * Queue and emit current request.
267 sclp_vt220_emit_current(void)
270 struct sclp_vt220_request *request;
271 struct sclp_vt220_sccb *sccb;
273 spin_lock_irqsave(&sclp_vt220_lock, flags);
275 if (sclp_vt220_current_request != NULL) {
276 sccb = (struct sclp_vt220_sccb *)
277 sclp_vt220_current_request->sclp_req.sccb;
278 /* Only emit buffers with content */
279 if (sccb->header.length != sizeof(struct sclp_vt220_sccb)) {
280 request = sclp_vt220_current_request;
281 sclp_vt220_current_request = NULL;
282 if (timer_pending(&sclp_vt220_timer))
283 del_timer(&sclp_vt220_timer);
285 sclp_vt220_flush_later = 0;
287 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
289 sclp_vt220_emit(request);
292 #define SCLP_NORMAL_WRITE 0x00
295 * Helper function to initialize a page with the sclp request structure.
297 static struct sclp_vt220_request *
298 sclp_vt220_initialize_page(void *page)
300 struct sclp_vt220_request *request;
301 struct sclp_vt220_sccb *sccb;
303 /* Place request structure at end of page */
304 request = ((struct sclp_vt220_request *)
305 ((addr_t) page + PAGE_SIZE)) - 1;
306 init_timer(&request->retry_timer);
307 request->retry_count = 0;
308 request->sclp_req.sccb = page;
309 /* SCCB goes at start of page */
310 sccb = (struct sclp_vt220_sccb *) page;
311 memset((void *) sccb, 0, sizeof(struct sclp_vt220_sccb));
312 sccb->header.length = sizeof(struct sclp_vt220_sccb);
313 sccb->header.function_code = SCLP_NORMAL_WRITE;
314 sccb->header.response_code = 0x0000;
315 sccb->evbuf.type = EvTyp_VT220Msg;
316 sccb->evbuf.length = sizeof(struct evbuf_header);
321 static inline unsigned int
322 sclp_vt220_space_left(struct sclp_vt220_request *request)
324 struct sclp_vt220_sccb *sccb;
325 sccb = (struct sclp_vt220_sccb *) request->sclp_req.sccb;
326 return PAGE_SIZE - sizeof(struct sclp_vt220_request) -
330 static inline unsigned int
331 sclp_vt220_chars_stored(struct sclp_vt220_request *request)
333 struct sclp_vt220_sccb *sccb;
334 sccb = (struct sclp_vt220_sccb *) request->sclp_req.sccb;
335 return sccb->evbuf.length - sizeof(struct evbuf_header);
339 * Add msg to buffer associated with request. Return the number of characters
343 sclp_vt220_add_msg(struct sclp_vt220_request *request,
344 const unsigned char *msg, int count, int convertlf)
346 struct sclp_vt220_sccb *sccb;
352 if (count > sclp_vt220_space_left(request))
353 count = sclp_vt220_space_left(request);
357 sccb = (struct sclp_vt220_sccb *) request->sclp_req.sccb;
358 buffer = (void *) ((addr_t) sccb + sccb->header.length);
361 /* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/
363 (from < count) && (to < sclp_vt220_space_left(request));
365 /* Retrieve character */
367 /* Perform conversion */
369 if (to + 1 < sclp_vt220_space_left(request)) {
370 ((unsigned char *) buffer)[to++] = c;
371 ((unsigned char *) buffer)[to++] = 0x0d;
376 ((unsigned char *) buffer)[to++] = c;
378 sccb->header.length += to;
379 sccb->evbuf.length += to;
382 memcpy(buffer, (const void *) msg, count);
383 sccb->header.length += count;
384 sccb->evbuf.length += count;
390 * Emit buffer after having waited long enough for more data to arrive.
393 sclp_vt220_timeout(unsigned long data)
395 sclp_vt220_emit_current();
398 #define BUFFER_MAX_DELAY HZ/2
401 * Internal implementation of the write function. Write COUNT bytes of data
403 * to the SCLP interface. In case that the data does not fit into the current
404 * write buffer, emit the current one and allocate a new one. If there are no
405 * more empty buffers available, wait until one gets emptied. If DO_SCHEDULE
406 * is non-zero, the buffer will be scheduled for emitting after a timeout -
407 * otherwise the user has to explicitly call the flush function.
408 * A non-zero CONVERTLF parameter indicates that 0x0a characters in the message
409 * buffer should be converted to 0x0a 0x0d. After completion, return the number
413 __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule,
424 spin_lock_irqsave(&sclp_vt220_lock, flags);
426 /* Create a sclp output buffer if none exists yet */
427 if (sclp_vt220_current_request == NULL) {
428 while (list_empty(&sclp_vt220_empty)) {
429 spin_unlock_irqrestore(&sclp_vt220_lock,
434 wait_event(sclp_vt220_waitq,
435 !list_empty(&sclp_vt220_empty));
436 spin_lock_irqsave(&sclp_vt220_lock, flags);
438 page = (void *) sclp_vt220_empty.next;
439 list_del((struct list_head *) page);
440 sclp_vt220_current_request =
441 sclp_vt220_initialize_page(page);
443 /* Try to write the string to the current request buffer */
444 written = sclp_vt220_add_msg(sclp_vt220_current_request,
445 buf, count, convertlf);
446 overall_written += written;
447 if (written == count)
450 * Not all characters could be written to the current
451 * output buffer. Emit the buffer, create a new buffer
452 * and then output the rest of the string.
454 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
455 sclp_vt220_emit_current();
456 spin_lock_irqsave(&sclp_vt220_lock, flags);
460 /* Setup timer to output current console buffer after some time */
461 if (sclp_vt220_current_request != NULL &&
462 !timer_pending(&sclp_vt220_timer) && do_schedule) {
463 sclp_vt220_timer.function = sclp_vt220_timeout;
464 sclp_vt220_timer.data = 0UL;
465 sclp_vt220_timer.expires = jiffies + BUFFER_MAX_DELAY;
466 add_timer(&sclp_vt220_timer);
468 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
469 return overall_written;
473 * This routine is called by the kernel to write a series of
474 * characters to the tty device. The characters may come from
475 * user space or kernel space. This routine will return the
476 * number of characters actually accepted for writing.
479 sclp_vt220_write(struct tty_struct *tty, int from_user,
480 const unsigned char *buf, int count)
486 return __sclp_vt220_write(buf, count, 1, 0);
487 /* Use intermediate buffer to prevent calling copy_from_user() while
491 length = count < SCLP_VT220_BUF_SIZE ?
492 count : SCLP_VT220_BUF_SIZE;
493 length -= copy_from_user(tty->driver_data,
494 (const unsigned char __user *)buf, length);
500 length = __sclp_vt220_write(tty->driver_data, length, 1, 0);
508 #define SCLP_VT220_SESSION_ENDED 0x01
509 #define SCLP_VT220_SESSION_STARTED 0x80
510 #define SCLP_VT220_SESSION_DATA 0x00
513 * Called by the SCLP to report incoming event buffers.
516 sclp_vt220_receiver_fn(struct evbuf_header *evbuf)
521 /* Ignore input if device is not open */
522 if (sclp_vt220_tty == NULL)
525 buffer = (char *) ((addr_t) evbuf + sizeof(struct evbuf_header));
526 count = evbuf->length - sizeof(struct evbuf_header);
529 case SCLP_VT220_SESSION_ENDED:
530 case SCLP_VT220_SESSION_STARTED:
532 case SCLP_VT220_SESSION_DATA:
533 /* Send input to line discipline */
536 /* Prevent buffer overrun by discarding input. Note that
537 * because buffer_push works asynchronously, we cannot wait
538 * for the buffer to be emptied. */
539 if (count + sclp_vt220_tty->flip.count > TTY_FLIPBUF_SIZE)
540 count = TTY_FLIPBUF_SIZE - sclp_vt220_tty->flip.count;
541 memcpy(sclp_vt220_tty->flip.char_buf_ptr, buffer, count);
542 memset(sclp_vt220_tty->flip.flag_buf_ptr, TTY_NORMAL, count);
543 sclp_vt220_tty->flip.char_buf_ptr += count;
544 sclp_vt220_tty->flip.flag_buf_ptr += count;
545 sclp_vt220_tty->flip.count += count;
546 tty_flip_buffer_push(sclp_vt220_tty);
552 * This routine is called when a particular tty device is opened.
555 sclp_vt220_open(struct tty_struct *tty, struct file *filp)
557 if (tty->count == 1) {
558 sclp_vt220_tty = tty;
559 tty->driver_data = kmalloc(SCLP_VT220_BUF_SIZE, GFP_KERNEL);
560 if (tty->driver_data == NULL)
562 tty->low_latency = 0;
568 * This routine is called when a particular tty device is closed.
571 sclp_vt220_close(struct tty_struct *tty, struct file *filp)
573 if (tty->count == 1) {
574 sclp_vt220_tty = NULL;
575 kfree(tty->driver_data);
576 tty->driver_data = NULL;
581 * This routine is called by the kernel to write a single
582 * character to the tty device. If the kernel uses this routine,
583 * it must call the flush_chars() routine (if defined) when it is
584 * done stuffing characters into the driver.
586 * NOTE: include/linux/tty_driver.h specifies that a character should be
587 * ignored if there is no room in the queue. This driver implements a different
588 * semantic in that it will block when there is no more room left.
591 sclp_vt220_put_char(struct tty_struct *tty, unsigned char ch)
593 __sclp_vt220_write(&ch, 1, 0, 0);
597 * This routine is called by the kernel after it has written a
598 * series of characters to the tty device using put_char().
601 sclp_vt220_flush_chars(struct tty_struct *tty)
603 if (sclp_vt220_outqueue_count == 0)
604 sclp_vt220_emit_current();
606 sclp_vt220_flush_later = 1;
610 * This routine returns the numbers of characters the tty driver
611 * will accept for queuing to be written. This number is subject
612 * to change as output buffers get emptied, or if the output flow
616 sclp_vt220_write_room(struct tty_struct *tty)
622 spin_lock_irqsave(&sclp_vt220_lock, flags);
624 if (sclp_vt220_current_request != NULL)
625 count = sclp_vt220_space_left(sclp_vt220_current_request);
626 list_for_each(l, &sclp_vt220_empty)
627 count += SCLP_VT220_MAX_CHARS_PER_BUFFER;
628 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
633 * Return number of buffered chars.
636 sclp_vt220_chars_in_buffer(struct tty_struct *tty)
640 struct sclp_vt220_request *r;
643 spin_lock_irqsave(&sclp_vt220_lock, flags);
645 if (sclp_vt220_current_request != NULL)
646 count = sclp_vt220_chars_stored(sclp_vt220_current_request);
647 list_for_each(l, &sclp_vt220_outqueue) {
648 r = list_entry(l, struct sclp_vt220_request, list);
649 count += sclp_vt220_chars_stored(r);
651 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
656 __sclp_vt220_flush_buffer(void)
660 sclp_vt220_emit_current();
661 spin_lock_irqsave(&sclp_vt220_lock, flags);
662 if (timer_pending(&sclp_vt220_timer))
663 del_timer(&sclp_vt220_timer);
664 while (sclp_vt220_outqueue_count > 0) {
665 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
667 spin_lock_irqsave(&sclp_vt220_lock, flags);
669 spin_unlock_irqrestore(&sclp_vt220_lock, flags);
673 * Pass on all buffers to the hardware. Return only when there are no more
677 sclp_vt220_flush_buffer(struct tty_struct *tty)
679 sclp_vt220_emit_current();
683 * Initialize all relevant components and register driver with system.
686 __sclp_vt220_init(int early)
691 if (sclp_vt220_initialized)
693 sclp_vt220_initialized = 1;
694 spin_lock_init(&sclp_vt220_lock);
695 INIT_LIST_HEAD(&sclp_vt220_empty);
696 INIT_LIST_HEAD(&sclp_vt220_outqueue);
697 init_waitqueue_head(&sclp_vt220_waitq);
698 init_timer(&sclp_vt220_timer);
699 sclp_vt220_current_request = NULL;
700 sclp_vt220_buffered_chars = 0;
701 sclp_vt220_outqueue_count = 0;
702 sclp_vt220_tty = NULL;
703 sclp_vt220_flush_later = 0;
705 /* Allocate pages for output buffering */
706 for (i = 0; i < (early ? MAX_CONSOLE_PAGES : MAX_KMEM_PAGES); i++) {
708 page = alloc_bootmem_low_pages(PAGE_SIZE);
710 page = (void *) get_zeroed_page(GFP_KERNEL | GFP_DMA);
713 list_add_tail((struct list_head *) page, &sclp_vt220_empty);
718 static struct tty_operations sclp_vt220_ops = {
719 .open = sclp_vt220_open,
720 .close = sclp_vt220_close,
721 .write = sclp_vt220_write,
722 .put_char = sclp_vt220_put_char,
723 .flush_chars = sclp_vt220_flush_chars,
724 .write_room = sclp_vt220_write_room,
725 .chars_in_buffer = sclp_vt220_chars_in_buffer,
726 .flush_buffer = sclp_vt220_flush_buffer
730 * Register driver with SCLP and Linux and initialize internal tty structures.
733 sclp_vt220_tty_init(void)
735 struct tty_driver *driver;
738 /* Note: we're not testing for CONSOLE_IS_SCLP here to preserve
739 * symmetry between VM and LPAR systems regarding ttyS1. */
740 driver = alloc_tty_driver(1);
743 rc = __sclp_vt220_init(0);
745 put_tty_driver(driver);
748 rc = sclp_register(&sclp_vt220_register);
750 printk(KERN_ERR SCLP_VT220_PRINT_HEADER
751 "could not register tty - "
752 "sclp_register returned %d\n", rc);
753 put_tty_driver(driver);
757 driver->owner = THIS_MODULE;
758 driver->driver_name = SCLP_VT220_DRIVER_NAME;
759 driver->name = SCLP_VT220_DEVICE_NAME;
760 driver->major = SCLP_VT220_MAJOR;
761 driver->minor_start = SCLP_VT220_MINOR;
762 driver->type = TTY_DRIVER_TYPE_SYSTEM;
763 driver->subtype = SYSTEM_TYPE_TTY;
764 driver->init_termios = tty_std_termios;
765 driver->flags = TTY_DRIVER_REAL_RAW;
766 tty_set_operations(driver, &sclp_vt220_ops);
768 rc = tty_register_driver(driver);
770 printk(KERN_ERR SCLP_VT220_PRINT_HEADER
771 "could not register tty - "
772 "tty_register_driver returned %d\n", rc);
773 put_tty_driver(driver);
776 sclp_vt220_driver = driver;
780 module_init(sclp_vt220_tty_init);
782 #ifdef CONFIG_SCLP_VT220_CONSOLE
785 sclp_vt220_con_write(struct console *con, const char *buf, unsigned int count)
787 __sclp_vt220_write((const unsigned char *) buf, count, 1, 1);
790 static struct tty_driver *
791 sclp_vt220_con_device(struct console *c, int *index)
794 return sclp_vt220_driver;
798 * This routine is called from panic when the kernel is going to give up.
799 * We have to make sure that all buffers will be flushed to the SCLP.
800 * Note that this function may be called from within an interrupt context.
803 sclp_vt220_con_unblank(void)
805 __sclp_vt220_flush_buffer();
808 /* Structure needed to register with printk */
809 static struct console sclp_vt220_console =
811 .name = SCLP_VT220_CONSOLE_NAME,
812 .write = sclp_vt220_con_write,
813 .device = sclp_vt220_con_device,
814 .unblank = sclp_vt220_con_unblank,
815 .flags = CON_PRINTBUFFER,
816 .index = SCLP_VT220_CONSOLE_INDEX
820 sclp_vt220_con_init(void)
824 if (!CONSOLE_IS_SCLP)
826 rc = __sclp_vt220_init(1);
829 /* Attach linux console */
830 register_console(&sclp_vt220_console);
834 console_initcall(sclp_vt220_con_init);
835 #endif /* CONFIG_SCLP_VT220_CONSOLE */