RTEMS  5.0.0
Functions | Variables
legacy-console.c File Reference

Extension of the generic libchip console driver shell. More...

#include <bsp.h>
#include <bsp/fatal.h>
#include <rtems/libio.h>
#include <rtems/console.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <termios.h>
#include <rtems/termiostypes.h>
#include <libchip/serial.h>
#include "legacy-console.h"

Functions

console_tblconsole_find_console_entry (const char *match, size_t length, rtems_device_minor_number *match_minor)
 console_find_console_entry More...
 
void console_initialize_data (void)
 console_initialize_data More...
 
void console_register_devices (console_tbl *new_ports, size_t number_of_ports)
 console_register_devices More...
 
rtems_device_driver console_open (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Console open entry point. More...
 
rtems_device_driver console_close (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Console close entry point. More...
 
rtems_device_driver console_initialize (rtems_device_major_number major, rtems_device_minor_number minor_arg, void *arg)
 Console initialization entry point. More...
 
rtems_device_driver console_read (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Console read entry point. More...
 
rtems_device_driver console_write (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Console write entry point. More...
 

Variables

unsigned long Console_Port_Count = 0
 
console_tbl ** Console_Port_Tbl = NULL
 
console_dataConsole_Port_Data = NULL
 
rtems_device_minor_number Console_Port_Minor = 0
 

Detailed Description

Extension of the generic libchip console driver shell.

Function Documentation

◆ console_close()

rtems_device_driver console_close ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Console close entry point.

This method closes a specific device supported by the console device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Return values
RTEMS_SUCCESSFULThe device driver is successfully closed.

◆ console_find_console_entry()

console_tbl* console_find_console_entry ( const char *  match,
size_t  length,
rtems_device_minor_number *  match_minor 
)

console_find_console_entry

This method is used to search the console entries for a specific device entry and return it. If match is NULL the minor number provided is matched.

◆ console_initialize()

rtems_device_driver console_initialize ( rtems_device_major_number  major,
rtems_device_minor_number  minor_arg,
void *  arg 
)

Console initialization entry point.

This method initializes the console device driver.

Parameters
[in]majoris the device driver major number.
[in]minoris the device driver minor number.
[in]argis the parameters to this call.
Return values
RTEMS_SUCCESSFULThe device driver is successfully initialized.

Console initialization entry point.

Initialize all serial drivers specified in driver_context_table

Parameters
[in]major
[in]minor
[in]arg
Return values
RTEMS_SUCCESSFULInitialization completed

This routine initializes the console IO driver.

Parameters

Parameters
majormajor number
minorminor number

Output parameters: NONE

Returns
void

◆ console_initialize_data()

void console_initialize_data ( void  )

console_initialize_data

This must be called before dynamic registration of devices can occur. It is normally called as a side-effect of console_initialize() but if a probe and dynamic registration occurs before that, then this method should be explicitly invoked.

◆ console_open()

rtems_device_driver console_open ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Console open entry point.

This method opens a specific device supported by the console device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Return values
RTEMS_SUCCESSFULThe device driver is successfully opened.

◆ console_read()

rtems_device_driver console_read ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Console read entry point.

This method reads from a specific device supported by the console device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Return values
RTEMS_SUCCESSFULThe device is successfully read from.

◆ console_register_devices()

void console_register_devices ( console_tbl new_ports,
size_t  number_of_ports 
)

console_register_devices

This function expands the console table to include previous ports and the array of new ports specified.

Parameters
[in]new_portsspecifies an array of new ports to register
[in]number_of_portsspecifies the number of elements in the new_ports array

◆ console_write()

rtems_device_driver console_write ( rtems_device_major_number  major,
rtems_device_minor_number  minor,
void *  arg 
)

Console write entry point.

This method writes to a specific device supported by the console device driver.

Parameters
[in]majoris the device driver major number
[in]minoris the device driver minor number
[in]argis the parameters to this call
Return values
RTEMS_SUCCESSFULThe device is successfully written.

Variable Documentation

◆ Console_Port_Count

unsigned long Console_Port_Count = 0

This is the number of serial ports defined in the Console_Port_Tbl.

◆ Console_Port_Data

console_data* Console_Port_Data = NULL

This is an array of per port information.

◆ Console_Port_Tbl

console_tbl** Console_Port_Tbl = NULL

This is a dynamically sized set of tables containing the serial port information.