source: rtems/c/src/lib/libbsp/m68k/mcf5235/console/console.c @ fb31ec0b

5
Last change on this file since fb31ec0b was fb31ec0b, checked in by Joel Sherrill <joel@…>, on 03/29/16 at 18:10:51

m68k/mcf5235: Remove include of <rtems/console.h> from <bsp.h> and fix warnings

  • Property mode set to 100644
File size: 20.8 KB
Line 
1 /*
2  *  Multi UART console serial I/O.
3  *
4  * TO DO: Add DMA input/output
5  */
6
7#include <stdio.h>
8#include <fcntl.h>
9#include <termios.h>
10#include <malloc.h>
11
12#include <rtems/libio.h>
13#include <rtems/termiostypes.h>
14#include <rtems/mw_uid.h>
15#include <rtems/bspIo.h>
16#include <rtems/console.h>
17#include <bsp.h>
18
19#define UART_INTC0_IRQ_VECTOR(x) (64+13+(x))
20
21#define MCF5235_UART_USR_ERROR ( MCF5235_UART_USR_RB | \
22                                 MCF5235_UART_USR_FE | \
23                                 MCF5235_UART_USR_PE | \
24                                 MCF5235_UART_USR_OE )
25
26static ssize_t IntUartPollWrite(int minor, const char *buf, size_t len);
27static ssize_t IntUartInterruptWrite (int minor, const char *buf, size_t len);
28
29static void
30_BSP_null_char( char c )
31{
32        int level;
33
34    if (c == '\n')
35        _BSP_null_char('\r');
36        rtems_interrupt_disable(level);
37    while ( (MCF5235_UART_USR(CONSOLE_PORT) & MCF5235_UART_USR_TXRDY) == 0 )
38        continue;
39    MCF5235_UART_UTB(CONSOLE_PORT) = c;
40    while ( (MCF5235_UART_USR(CONSOLE_PORT) & MCF5235_UART_USR_TXRDY) == 0 )
41        continue;
42        rtems_interrupt_enable(level);
43}
44BSP_output_char_function_type     BSP_output_char = _BSP_null_char;
45BSP_polling_getchar_function_type BSP_poll_char = NULL;
46
47#define MAX_UART_INFO     3
48#define RX_BUFFER_SIZE    512
49
50struct IntUartInfoStruct
51{
52        int                    iomode;
53        volatile int           uimr;
54        int                    baud;
55        int                    databits;
56        int                    parity;
57        int                    stopbits;
58        int                    hwflow;
59        int                    rx_in;
60        int                    rx_out;
61        char                   rx_buffer[RX_BUFFER_SIZE];
62        void                  *ttyp;
63};
64
65struct IntUartInfoStruct IntUartInfo[MAX_UART_INFO];
66
67/***************************************************************************
68   Function : IntUartSet
69
70   Description : This updates the hardware UART settings.
71 ***************************************************************************/
72static void
73IntUartSet(int minor, int baud, int databits, int parity, int stopbits, int hwflow)
74{
75        int                         divisor;
76        uint32_t                                        clock_speed;
77        uint8_t                   umr1 = 0;
78        uint8_t                   umr2 = 0;
79        struct IntUartInfoStruct   *info = &IntUartInfo[minor];
80        int                         level;
81
82        rtems_interrupt_disable(level);
83
84
85        /* disable interrupts, clear RTS line, and disable the UARTS */
86        MCF5235_UART_UIMR(minor) = 0;
87        MCF5235_UART_UOP0(minor) = 1;
88        MCF5235_UART_UCR(minor) = (MCF5235_UART_UCR_TX_DISABLED | MCF5235_UART_UCR_RX_DISABLED);
89
90        /* save the current values */
91        info->uimr     = 0;
92        info->baud     = baud;
93        info->databits = databits;
94        info->parity   = parity;
95        info->stopbits = stopbits;
96        info->hwflow   = hwflow;
97
98    clock_speed = get_CPU_clock_speed();
99    /* determine the baud divisor value */
100    divisor = ((clock_speed/2) / ( 32 * baud ));
101    if ( divisor < 2 )
102        divisor = 2;
103
104        /* check to see if doing hardware flow control */
105        if ( hwflow )
106        {
107                /* set hardware flow options */
108                umr1 |= MCF5235_UART_UMR_RXRTS;
109                umr2 |= MCF5235_UART_UMR_TXCTS;
110        }
111
112        /* determine the new umr values */
113        umr1 |= (parity | databits);
114        umr2 |= (stopbits);
115
116        /* reset the uart */
117        MCF5235_UART_UCR(minor) = MCF5235_UART_UCR_RESET_ERROR;
118        MCF5235_UART_UCR(minor) = MCF5235_UART_UCR_RESET_RX;
119        MCF5235_UART_UCR(minor) = MCF5235_UART_UCR_RESET_TX;
120
121        /* reset the uart mode register and update values */
122        MCF5235_UART_UCR(minor) = MCF5235_UART_UCR_RESET_MR;
123        MCF5235_UART_UMR(minor) = umr1;
124        MCF5235_UART_UMR(minor) = umr2;
125
126        /* set the baud rate values */
127        MCF5235_UART_UCSR(minor) = (MCF5235_UART_UCSR_RCS_SYS_CLK | MCF5235_UART_UCSR_TCS_SYS_CLK);
128        MCF5235_UART_UBG1(minor) = (divisor & 0xff00) >> 8;
129        MCF5235_UART_UBG2(minor) = (divisor & 0x00ff);
130
131        /* enable the uart */
132    MCF5235_UART_UCR(minor) = (MCF5235_UART_UCR_TX_ENABLED | MCF5235_UART_UCR_RX_ENABLED);
133
134        /* check to see if interrupts need to be enabled */
135        if ( info->iomode != TERMIOS_POLLED )
136        {
137                /* enable rx interrupts */
138                info->uimr |= MCF5235_UART_UIMR_FFULL;
139                MCF5235_UART_UIMR(minor) = info->uimr;
140        }
141
142        /* check to see if doing hardware flow control */
143        if ( hwflow )
144        {
145                /* assert the RTS line */
146                MCF5235_UART_UOP1(minor) = 1;
147        }
148
149        rtems_interrupt_enable(level);
150
151}
152
153
154/***************************************************************************
155   Function : IntUartSetAttributes
156
157   Description : This provides the hardware-dependent portion of tcsetattr().
158   value and sets it. At the moment this just sets the baud rate.
159
160   Note: The highest baudrate is 115200 as this stays within
161   an error of +/- 5% at 25MHz processor clock
162 ***************************************************************************/
163static int
164IntUartSetAttributes(int minor, const struct termios *t)
165{
166        /* set default index values */
167        int                         baud     = (int)19200;
168        int                         databits = (int)MCF5235_UART_UMR_BC_8;
169        int                         parity   = (int)MCF5235_UART_UMR_PM_NONE;
170        int                         stopbits = (int)MCF5235_UART_UMR_STOP_BITS_1;
171        int                         hwflow   = (int)0;
172        struct IntUartInfoStruct   *info     = &IntUartInfo[minor];
173
174        /* check to see if input is valid */
175        if ( t != (const struct termios *)0 )
176        {
177                /* determine baud rate index */
178                baud = rtems_termios_baud_to_number(t->c_cflag & CBAUD);
179
180                /* determine data bits */
181                switch ( t->c_cflag & CSIZE )
182                {
183                        case CS5:
184                                databits = (int)MCF5235_UART_UMR_BC_5;
185                                break;
186                        case CS6:
187                                databits = (int)MCF5235_UART_UMR_BC_6;
188                                break;
189                        case CS7:
190                                databits = (int)MCF5235_UART_UMR_BC_7;
191                                break;
192                        case CS8:
193                                databits = (int)MCF5235_UART_UMR_BC_8;
194                                break;
195                }
196
197                /* determine if parity is enabled */
198                if ( t->c_cflag & PARENB )
199                {
200                        if ( t->c_cflag & PARODD )
201                        {
202                                /* odd parity */
203                                parity = (int)MCF5235_UART_UMR_PM_ODD;
204                        }
205                        else
206                        {
207                                /* even parity */
208                                parity = (int)MCF5235_UART_UMR_PM_EVEN;
209                        }
210                }
211
212                /* determine stop bits */
213                if ( t->c_cflag & CSTOPB )
214                {
215                        /* two stop bits */
216                        stopbits = (int)MCF5235_UART_UMR_STOP_BITS_2;
217                }
218
219                /* check to see if hardware flow control */
220                if ( t->c_cflag & CRTSCTS )
221                {
222                        hwflow = 1;
223                }
224        }
225
226        /* check to see if values have changed */
227        if ( ( baud     != info->baud     ) ||
228                 ( databits != info->databits ) ||
229                 ( parity   != info->parity   ) ||
230                 ( stopbits != info->stopbits ) ||
231                 ( hwflow   != info->hwflow   ) )
232        {
233
234                /* call function to set values */
235                IntUartSet(minor, baud, databits, parity, stopbits, hwflow);
236        }
237
238        return( RTEMS_SUCCESSFUL );
239
240}
241
242/***************************************************************************
243   Function : IntUartInterruptHandler
244
245   Description : This is the interrupt handler for the internal uart. It
246   determines which channel caused the interrupt before queueing any received
247   chars and dequeueing chars waiting for transmission.
248 ***************************************************************************/
249static rtems_isr
250IntUartInterruptHandler(rtems_vector_number v)
251{
252        unsigned int                chan = v - UART_INTC0_IRQ_VECTOR(0);
253        struct IntUartInfoStruct   *info = &IntUartInfo[chan];
254
255        /* check to see if received data */
256        if ( MCF5235_UART_UISR(chan) & MCF5235_UART_UISR_RXRDY )
257        {
258                /* read data and put into the receive buffer */
259                while ( MCF5235_UART_USR(chan) & MCF5235_UART_USR_RXRDY )
260                {
261
262                        if ( MCF5235_UART_USR(chan) & MCF5235_UART_USR_ERROR )
263                        {
264                                /* clear the error */
265                                MCF5235_UART_UCR(chan) = MCF5235_UART_UCR_RESET_ERROR;
266                        }
267                        /* put data in rx buffer and check for errors */
268                        info->rx_buffer[info->rx_in] = MCF5235_UART_URB(chan);
269
270                        /* update buffer values */
271                        info->rx_in++;
272
273                        if ( info->rx_in >= RX_BUFFER_SIZE )
274                        {
275                                info->rx_in = 0;
276                        }
277                }
278                /* Make sure the port has been opened */
279                if ( info->ttyp )
280                {
281
282                        /* check to see if task driven */
283                        if ( info->iomode == TERMIOS_TASK_DRIVEN )
284                        {
285                                /* notify rx task that rx buffer has data */
286                                rtems_termios_rxirq_occured(info->ttyp);
287                        }
288                        else
289                        {
290                                /* Push up the received data */
291                                rtems_termios_enqueue_raw_characters(info->ttyp, info->rx_buffer, info->rx_in);
292                                info->rx_in    = 0;
293                        }
294                }
295        }
296
297        /* check to see if data needs to be transmitted */
298        if ( ( info->uimr & MCF5235_UART_UIMR_TXRDY ) &&
299                 ( MCF5235_UART_UISR(chan) & MCF5235_UART_UISR_TXRDY ) )
300        {
301
302                /* disable tx interrupts */
303                info->uimr &= ~MCF5235_UART_UIMR_TXRDY;
304                MCF5235_UART_UIMR(chan) = info->uimr;
305
306                /* tell upper level that character has been sent */
307                if ( info->ttyp )
308                        rtems_termios_dequeue_characters(info->ttyp, 1);
309        }
310}
311
312
313
314/***************************************************************************
315   Function : IntUartInitialize
316
317   Description : This initialises the internal uart hardware for all
318   internal uarts. If the internal uart is to be interrupt driven then the
319   interrupt vectors are hooked.
320 ***************************************************************************/
321static void
322IntUartInitialize(void)
323{
324        unsigned int        chan;
325        struct IntUartInfoStruct   *info;
326        rtems_isr_entry old_handler;
327    int level;
328
329        for ( chan = 0; chan < MAX_UART_INFO; chan++ )
330        {
331                info = &IntUartInfo[chan];
332
333                info->ttyp     = NULL;
334                info->rx_in    = 0;
335                info->rx_out   = 0;
336                info->baud     = -1;
337                info->databits = -1;
338                info->parity   = -1;
339                info->stopbits = -1;
340                info->hwflow   = -1;
341                info->iomode   = TERMIOS_POLLED; /*polled console io */
342
343                MCF5235_UART_UACR(chan) = 0;
344                MCF5235_UART_UIMR(chan) = 0;
345                if ( info->iomode != TERMIOS_POLLED )
346                {
347                        rtems_interrupt_catch (IntUartInterruptHandler,
348                                                                   UART_INTC0_IRQ_VECTOR(chan),
349                                                                   &old_handler);
350                }
351
352                /* set uart default values */
353                IntUartSetAttributes(chan, NULL);
354
355        /* unmask interrupt */
356                rtems_interrupt_disable(level);
357        switch(chan) {
358        case 0:
359            MCF5235_INTC0_ICR13 = MCF5235_INTC_ICR_IL(UART0_IRQ_LEVEL) |
360                                  MCF5235_INTC_ICR_IP(UART0_IRQ_PRIORITY);
361            MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT13 |
362                                    MCF5235_INTC0_IMRL_MASKALL);
363            break;
364
365        case 1:
366            MCF5235_INTC0_ICR14 = MCF5235_INTC_ICR_IL(UART1_IRQ_LEVEL) |
367                                  MCF5235_INTC_ICR_IP(UART1_IRQ_PRIORITY);
368            MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT14 |
369                                    MCF5235_INTC0_IMRL_MASKALL);
370            break;
371
372        case 2:
373            MCF5235_INTC0_ICR15 = MCF5235_INTC_ICR_IL(UART2_IRQ_LEVEL) |
374                                  MCF5235_INTC_ICR_IP(UART2_IRQ_PRIORITY);
375            MCF5235_INTC0_IMRL &= ~(MCF5235_INTC0_IMRL_INT15 |
376                                    MCF5235_INTC0_IMRL_MASKALL);
377            break;
378        }
379                rtems_interrupt_enable(level);
380
381        } /* of chan loop */
382
383
384} /* IntUartInitialise */
385
386
387/***************************************************************************
388   Function : IntUartInterruptWrite
389
390   Description : This writes a single character to the appropriate uart
391   channel. This is either called during an interrupt or in the user's task
392   to initiate a transmit sequence. Calling this routine enables Tx
393   interrupts.
394 ***************************************************************************/
395static ssize_t
396IntUartInterruptWrite (int minor, const char *buf, size_t len)
397{
398        if (len > 0) {
399                /* write out character */
400                MCF5235_UART_UTB(minor) = *buf;
401
402                /* enable tx interrupt */
403                IntUartInfo[minor].uimr |= MCF5235_UART_UIMR_TXRDY;
404                MCF5235_UART_UIMR(minor) = IntUartInfo[minor].uimr;
405        }
406
407        return( 0 );
408}
409
410/***************************************************************************
411   Function : IntUartInterruptOpen
412
413   Description : This enables interrupts when the tty is opened.
414 ***************************************************************************/
415static int
416IntUartInterruptOpen(int major, int minor, void *arg)
417{
418        struct IntUartInfoStruct   *info = &IntUartInfo[minor];
419
420        /* enable the uart */
421        MCF5235_UART_UCR(minor) = (MCF5235_UART_UCR_TX_ENABLED | MCF5235_UART_UCR_RX_ENABLED);
422
423        /* check to see if interrupts need to be enabled */
424        if ( info->iomode != TERMIOS_POLLED )
425        {
426                /* enable rx interrupts */
427                info->uimr |= MCF5235_UART_UIMR_FFULL;
428                MCF5235_UART_UIMR(minor) = info->uimr;
429        }
430
431        /* check to see if doing hardware flow control */
432        if ( info->hwflow )
433        {
434                /* assert the RTS line */
435                MCF5235_UART_UOP1(minor) = 1;
436        }
437
438        return( 0 );
439}
440
441
442
443/***************************************************************************
444   Function : IntUartInterruptClose
445
446   Description : This disables interrupts when the tty is closed.
447 ***************************************************************************/
448static int
449IntUartInterruptClose(int major, int minor, void *arg)
450{
451        struct IntUartInfoStruct   *info = &IntUartInfo[minor];
452
453        /* disable the interrupts and the uart */
454        MCF5235_UART_UIMR(minor) = 0;
455        MCF5235_UART_UCR(minor) = (MCF5235_UART_UCR_TX_DISABLED | MCF5235_UART_UCR_RX_DISABLED);
456
457        /* reset values */
458        info->ttyp     = NULL;
459        info->uimr       = 0;
460        info->rx_in    = 0;
461        info->rx_out   = 0;
462
463        return( 0 );
464}
465
466/***************************************************************************
467   Function : IntUartTaskRead
468
469   Description : This reads all available characters from the internal uart
470   and places them into the termios buffer.  The rx interrupts will be
471   re-enabled after all data has been read.
472 ***************************************************************************/
473static int
474IntUartTaskRead(int minor)
475{
476        char                        buffer[RX_BUFFER_SIZE];
477        int                         count;
478        int                         rx_in;
479        int                         index = 0;
480        struct IntUartInfoStruct   *info  = &IntUartInfo[minor];
481
482        /* determine number of values to copy out */
483        rx_in = info->rx_in;
484        if ( info->rx_out <= rx_in )
485        {
486                count = rx_in - info->rx_out;
487        }
488        else
489        {
490                count = (RX_BUFFER_SIZE - info->rx_out) + rx_in;
491        }
492
493        /* copy data into local buffer from rx buffer */
494        while ( ( index < count ) && ( index < RX_BUFFER_SIZE ) )
495        {
496                /* copy data byte */
497                buffer[index] = info->rx_buffer[info->rx_out];
498                index++;
499
500                /* increment rx buffer values */
501                info->rx_out++;
502                if ( info->rx_out >= RX_BUFFER_SIZE )
503                {
504                        info->rx_out = 0;
505                }
506        }
507
508        /* check to see if buffer is not empty */
509        if ( count > 0 )
510        {
511                /* set characters into termios buffer  */
512                rtems_termios_enqueue_raw_characters(info->ttyp, buffer, count);
513        }
514
515        return( EOF );
516}
517
518
519
520/***************************************************************************
521   Function : IntUartPollRead
522
523   Description : This reads a character from the internal uart. It returns
524   to the caller without blocking if not character is waiting.
525 ***************************************************************************/
526static int
527IntUartPollRead (int minor)
528{
529        if ( (MCF5235_UART_USR(minor) & MCF5235_UART_USR_RXRDY) == 0 )
530                return(-1);
531
532        return(MCF5235_UART_URB(minor));
533}
534
535
536/***************************************************************************
537   Function : IntUartPollWrite
538
539   Description : This writes out each character in the buffer to the
540   appropriate internal uart channel waiting till each one is sucessfully
541   transmitted.
542 ***************************************************************************/
543static ssize_t
544IntUartPollWrite (int minor, const char *buf, size_t len)
545{
546        size_t retval = len;
547        /* loop over buffer */
548        while ( len-- )
549        {
550                /* block until we can transmit */
551                while ( (MCF5235_UART_USR(minor) & MCF5235_UART_USR_TXRDY) == 0 )
552                        continue;
553                /* transmit data byte */
554                MCF5235_UART_UTB(minor) = *buf++;
555        }
556        return retval;
557}
558
559/***************************************************************************
560   Function : console_initialize
561
562   Description : This initialises termios, both sets of uart hardware before
563   registering /dev/tty devices for each channel and the system /dev/console.
564 ***************************************************************************/
565rtems_device_driver console_initialize(
566        rtems_device_major_number  major,
567        rtems_device_minor_number  minor,
568        void  *arg )
569{
570        rtems_status_code status;
571
572
573        /* Set up TERMIOS */
574        rtems_termios_initialize ();
575
576        /* set io modes for the different channels and initialize device */
577    IntUartInfo[minor].iomode = TERMIOS_IRQ_DRIVEN;
578        IntUartInitialize();
579
580        /* Register the console port */
581        status = rtems_io_register_name ("/dev/console", major, CONSOLE_PORT);
582        if ( status != RTEMS_SUCCESSFUL )
583        {
584                rtems_fatal_error_occurred (status);
585        }
586
587        /* Register the other port */
588        if ( CONSOLE_PORT != 0 )
589        {
590                status = rtems_io_register_name ("/dev/tty00", major, 0);
591                if ( status != RTEMS_SUCCESSFUL )
592                {
593                        rtems_fatal_error_occurred (status);
594                }
595        }
596        if ( CONSOLE_PORT != 1 )
597        {
598                status = rtems_io_register_name ("/dev/tty01", major, 1);
599                if ( status != RTEMS_SUCCESSFUL )
600                {
601                        rtems_fatal_error_occurred (status);
602                }
603        }
604
605        return(RTEMS_SUCCESSFUL);
606}
607
608/***************************************************************************
609   Function : console_open
610
611   Description : This actually opens the device depending on the minor
612   number set during initialisation. The device specific access routines are
613   passed to termios when the devices is opened depending on whether it is
614   polled or not.
615 ***************************************************************************/
616rtems_device_driver console_open(
617        rtems_device_major_number major,
618        rtems_device_minor_number minor,
619        void  * arg)
620{
621        rtems_status_code                status = RTEMS_INVALID_NUMBER;
622        rtems_libio_open_close_args_t   *args   = (rtems_libio_open_close_args_t *)arg;
623        struct IntUartInfoStruct        *info;
624
625        static const rtems_termios_callbacks IntUartPollCallbacks = {
626                NULL,                             /* firstOpen */
627                NULL,                             /* lastClose */
628                IntUartPollRead,          /* pollRead */
629                IntUartPollWrite,         /* write */
630                IntUartSetAttributes, /* setAttributes */
631                NULL,                             /* stopRemoteTx */
632                NULL,                             /* startRemoteTx */
633                TERMIOS_POLLED            /* mode */
634        };
635        static const rtems_termios_callbacks IntUartIntrCallbacks = {
636                IntUartInterruptOpen,  /* firstOpen */
637                IntUartInterruptClose, /* lastClose */
638                NULL,                              /* pollRead */
639                IntUartInterruptWrite, /* write */
640                IntUartSetAttributes,  /* setAttributes */
641                NULL,                              /* stopRemoteTx */
642                NULL,                              /* startRemoteTx */
643                TERMIOS_IRQ_DRIVEN         /* mode */
644        };
645
646        static const rtems_termios_callbacks IntUartTaskCallbacks = {
647                IntUartInterruptOpen,  /* firstOpen */
648                IntUartInterruptClose, /* lastClose */
649                IntUartTaskRead,           /* pollRead */
650                IntUartInterruptWrite, /* write */
651                IntUartSetAttributes,  /* setAttributes */
652                NULL,                              /* stopRemoteTx */
653                NULL,                              /* startRemoteTx */
654                TERMIOS_TASK_DRIVEN        /* mode */
655        };
656
657        /* open the port depending on the minor device number */
658        if ( ( minor >= 0 ) && ( minor < MAX_UART_INFO ) )
659        {
660                info = &IntUartInfo[minor];
661                switch ( info->iomode )
662                {
663                        case TERMIOS_POLLED:
664                                status = rtems_termios_open(major, minor, arg, &IntUartPollCallbacks);
665                                break;
666                        case TERMIOS_IRQ_DRIVEN:
667                                status = rtems_termios_open(major, minor, arg, &IntUartIntrCallbacks);
668                                info->ttyp = args->iop->data1;
669                                break;
670                        case TERMIOS_TASK_DRIVEN:
671                                status = rtems_termios_open(major, minor, arg, &IntUartTaskCallbacks);
672                                info->ttyp = args->iop->data1;
673                                break;
674                }
675        }
676
677  if (status == RTEMS_SUCCESSFUL)
678  {
679    /*
680     * Reset the default baudrate.
681     */
682    struct termios term;
683    if (tcgetattr (STDIN_FILENO, &term) >= 0)
684    {
685      term.c_cflag &= ~(CBAUD | CSIZE);
686      term.c_cflag |= CS8 | B19200;
687      tcsetattr (STDIN_FILENO, TCSANOW, &term);
688    }
689  }
690
691        return( status );
692}
693
694/***************************************************************************
695   Function : console_close
696
697   Description : This closes the device via termios
698 ***************************************************************************/
699rtems_device_driver console_close(
700        rtems_device_major_number major,
701        rtems_device_minor_number minor,
702        void   * arg)
703{
704    return(rtems_termios_close (arg));
705}
706
707/******************
708*********************************************************
709   Function : console_read
710
711   Description : Read from the device via termios
712 ***************************************************************************/
713rtems_device_driver console_read(
714        rtems_device_major_number major,
715        rtems_device_minor_number minor,
716        void  * arg)
717{
718    return(rtems_termios_read (arg));
719}
720
721/***************************************************************************
722   Function : console_write
723
724   Description : Write to the device via termios
725 ***************************************************************************/
726rtems_device_driver console_write(
727        rtems_device_major_number major,
728        rtems_device_minor_number minor,
729        void  * arg)
730{
731    return(rtems_termios_write (arg));
732}
733
734/***************************************************************************
735   Function : console_ioctl
736
737   Description : Pass the IOCtl call to termios
738 ***************************************************************************/
739rtems_device_driver console_control(
740        rtems_device_major_number major,
741        rtems_device_minor_number minor,
742        void  * arg)
743{
744    return( rtems_termios_ioctl (arg) );
745}
Note: See TracBrowser for help on using the repository browser.