]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
stdio/device: rework function naming convention
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Sat, 16 May 2009 10:14:54 +0000 (12:14 +0200)
committerWolfgang Denk <wd@denx.de>
Fri, 17 Jul 2009 22:27:46 +0000 (00:27 +0200)
So far the console API uses the following naming convention:

======Extract======
typedef struct device_t;

int device_register (device_t * dev);
int devices_init (void);
int device_deregister(char *devname);
struct list_head* device_get_list(void);
device_t* device_get_by_name(char* name);
device_t* device_clone(device_t *dev);
=======

which is too generic and confusing.

Instead of using device_XX and device_t we change this
into stdio_XX and stdio_dev

This will also allow to add later a generic device mechanism in order
to have support for multiple devices and driver instances.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Edited commit message.

Signed-off-by: Wolfgang Denk <wd@denx.de>
63 files changed:
board/MAI/AmigaOneG3SE/ps2kbd.c
board/MAI/AmigaOneG3SE/video.c
board/bf527-ezkit/video.c
board/bf533-stamp/video.c
board/bf548-ezkit/video.c
board/bmw/bmw.c
board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
board/linkstation/avr.c
board/mpl/common/common_util.c
board/mpl/common/isa.c
board/mpl/common/kbd.c
board/mpl/pati/pati.c
board/netphone/phone_console.c
board/rbc823/kbd.c
board/trab/vfd.c
common/Makefile
common/cmd_console.c
common/cmd_log.c
common/cmd_terminal.c
common/console.c
common/iomux.c
common/lcd.c
common/serial.c
common/stdio.c [moved from common/devices.c with 84% similarity]
common/usb_kbd.c
cpu/blackfin/jtag-console.c
cpu/mpc512x/diu.c
cpu/mpc8xx/lcd.c
cpu/mpc8xx/video.c
cpu/pxa/pxafb.c
drivers/input/keyboard.c
drivers/net/netconsole.c
drivers/serial/arm_dcc.c
drivers/serial/usbtty.c
drivers/usb/musb/musb_hcd.c
drivers/usb/musb/musb_hcd.h
drivers/video/cfb_console.c
include/configs/AmigaOneG3SE.h
include/configs/MIP405.h
include/configs/MPC8610HPCD.h
include/configs/MPC8641HPCN.h
include/configs/PIP405.h
include/configs/VCMA9.h
include/configs/gr_ep2s60.h
include/configs/mp2usb.h
include/console.h [deleted file]
include/iomux.h
include/serial.h
include/stdio_dev.h [moved from include/devices.h with 85% similarity]
lib_arm/board.c
lib_avr32/board.c
lib_blackfin/board.c
lib_blackfin/post.c
lib_i386/board.c
lib_i386/video.c
lib_m68k/board.c
lib_mips/board.c
lib_nios/board.c
lib_nios2/board.c
lib_ppc/board.c
lib_sh/board.c
lib_sparc/board.c
post/post.c

index a297005ed28b4db77de8c3c7c4294e19123d9cdf..aa164b0c9fdf51f4ae01c656959ba9b24b471f58 100644 (file)
@@ -34,7 +34,7 @@
  */
 #include <common.h>
 #include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "ps2kbd.h"
 
 
@@ -226,7 +226,7 @@ int overwrite_console (void)
 int drv_isa_kbd_init (void)
 {
        int error;
-       device_t kbddev ;
+       struct stdio_dev kbddev ;
        char *stdinname  = getenv ("stdin");
 
        if(isa_kbd_init() == -1)
@@ -239,7 +239,7 @@ int drv_isa_kbd_init (void)
        kbddev.getc = kbd_getc ;
        kbddev.tstc = kbd_testc ;
 
-       error = device_register (&kbddev);
+       error = stdio_register (&kbddev);
        if(error==0) {
                /* check if this is the standard input device */
                if(strcmp(stdinname,DEVNAME)==0) {
index fc27c685835fe0ed570275cb2a897010fbb56126..e24e28b392542235b68c3b56911fa0e9431e481f 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "memio.h"
 #include <part.h>
 
@@ -98,7 +98,7 @@ int video_inited = 0;
 int drv_video_init(void)
 {
     int error, devices = 1 ;
-    device_t vgadev ;
+    struct stdio_dev vgadev ;
     if (video_inited) return 1;
     video_inited = 1;
     video_init();
@@ -112,7 +112,7 @@ int drv_video_init(void)
     vgadev.tstc = NULL;
     vgadev.start = video_start;
 
-    error = device_register (&vgadev);
+    error = stdio_register (&vgadev);
 
     if (error == 0)
     {
index 2df671730842a856dadd809a52a046502bcc91e6..0b6b7b2e76d184c2589bc8fe7c0ae4d10a77a527 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/mach-common/bits/dma.h>
 #include <i2c.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 int gunzip(void *, int, unsigned char *, unsigned long *);
 
@@ -272,7 +272,7 @@ void video_puts(const char *s)
 int drv_video_init(void)
 {
        int error, devices = 1;
-       device_t videodev;
+       struct stdio_dev videodev;
 
        u8 *dst;
        u32 fbmem_size = LCD_X_RES * LCD_Y_RES * LCD_PIXEL_SIZE + ACTIVE_VIDEO_MEM_OFFSET;
@@ -311,7 +311,7 @@ int drv_video_init(void)
        videodev.putc = video_putc;     /* 'putc' function */
        videodev.puts = video_puts;     /* 'puts' function */
 
-       error = device_register(&videodev);
+       error = stdio_register(&videodev);
 
        return (error == 0) ? devices : error;
 }
index 3c15eaa7657679951c2fdc257398fe2b90cc38df..28ffa618fc6c5cb083140ffef2547aa7bcfb83dd 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/mach-common/bits/dma.h>
 #include <i2c.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 int gunzip(void *, int, unsigned char *, unsigned long *);
 
@@ -154,7 +154,7 @@ static void video_init(char *NTSCFrame)
 
 int drv_video_init(void)
 {
-       device_t videodev;
+       struct stdio_dev videodev;
 
        video_init((void *)NTSC_FRAME_ADDR);
 
@@ -163,5 +163,5 @@ int drv_video_init(void)
        videodev.ext = DEV_EXT_VIDEO;
        videodev.flags = DEV_FLAGS_SYSTEM;
 
-       return device_register(&videodev);
+       return stdio_register(&videodev);
 }
index a6f52bdfef11261b4760163b1efc12f5d4df3b49..f4f1becae2162715f2dc8a4fd1f6797318f2a856 100644 (file)
@@ -14,7 +14,7 @@
 #include <asm/mach-common/bits/dma.h>
 #include <i2c.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 int gunzip(void *, int, unsigned char *, unsigned long *);
 
@@ -282,7 +282,7 @@ void video_puts(const char *s)
 int drv_video_init(void)
 {
        int error, devices = 1;
-       device_t videodev;
+       struct stdio_dev videodev;
 
        u8 *dst;
        u32 fbmem_size = LCD_X_RES * LCD_Y_RES * LCD_PIXEL_SIZE + ACTIVE_VIDEO_MEM_OFFSET;
@@ -321,7 +321,7 @@ int drv_video_init(void)
        videodev.putc = video_putc;     /* 'putc' function */
        videodev.puts = video_puts;     /* 'puts' function */
 
-       error = device_register(&videodev);
+       error = stdio_register(&videodev);
 
        return (error == 0) ? devices : error;
 }
index 41ce14f653d74343412f270bc2edc2a0cd4412c4..870011e6fc1d0827bc2f5335f67ec81609d529fe 100644 (file)
@@ -26,7 +26,7 @@
 #include <watchdog.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <net.h>
 #include <timestamp.h>
 #include <dtt.h>
index 0ad878c2934fe46cfc639cee01891be77a3b64b1..63eba0c599379cd7a4a40e1486adb47a691768d4 100644 (file)
@@ -33,7 +33,7 @@
 #include "../common/fsl_diu_fb.h"
 
 #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
-#include <devices.h>
+#include <stdio_dev.h>
 #include <video_fb.h>
 #endif
 
index 782b24a71aaaef17c79ec7d2fde157bd67dcae71..ec6d400d34e6dcb420116c684c0328e119b23486 100644 (file)
@@ -22,7 +22,7 @@
  */
 #include <common.h>
 #include <ns16550.h>
-#include <console.h>
+#include <stdio_dev.h>
 
 /* Button codes from the AVR */
 #define PWRR                   0x20            /* Power button release */
index d16939120ae0d4171007e756cd6e8fb482e4c855..243e3eb7f915ba762cfbcbc16a871c136762637e 100644 (file)
@@ -29,7 +29,7 @@
 #include <asm/processor.h>
 #include <asm/byteorder.h>
 #include <i2c.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <pci.h>
 #include <malloc.h>
 #include <bzlib.h>
index 91829d44f3c61f14f6e9eb1f40c7c1829380172a..5d467b48dc30fab456e11e628a73398b5e19aa5c 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <common.h>
 #include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "isa.h"
 #include "piix4_pci.h"
 #include "kbd.h"
index a457635d4de010e4fad90cabe10acfd90f19b381..b0a9620232dcc203e166264ea5d2724469a5c0f8 100644 (file)
@@ -28,7 +28,7 @@
  */
 #include <common.h>
 #include <asm/processor.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "isa.h"
 #include "kbd.h"
 
@@ -215,7 +215,7 @@ int overwrite_console (void)
 int drv_isa_kbd_init (void)
 {
        int error;
-       device_t kbddev ;
+       struct stdio_dev kbddev ;
        char *stdinname  = getenv ("stdin");
 
        if(isa_kbd_init()==-1)
@@ -228,7 +228,7 @@ int drv_isa_kbd_init (void)
        kbddev.getc = kbd_getc ;
        kbddev.tstc = kbd_testc ;
 
-       error = device_register (&kbddev);
+       error = stdio_register (&kbddev);
        if(error==0) {
                /* check if this is the standard input device */
                if(strcmp(stdinname,DEVNAME)==0) {
index 85c5af956d3b59a0cd87a7ea2714e9412d0c2b25..8f23d2dc0e355bea65b6bbe06a33fe6a581ee135 100644 (file)
@@ -46,7 +46,7 @@
 
 #include <common.h>
 #include <mpc5xx.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <pci_ids.h>
 #define PLX9056_LOC
 #include "plx9056.h"
@@ -447,7 +447,7 @@ int checkboard (void)
 int recbuf[REC_BUFFER_SIZE];
 static int r_ptr = 0;
 int w_ptr;
-device_t pci_con_dev;
+struct stdio_dev pci_con_dev;
 int conn=0;
 int buff_full=0;
 
@@ -584,7 +584,7 @@ void pci_con_connect(void)
        pci_con_dev.puts = pci_con_puts;
        pci_con_dev.getc = pci_con_getc;
        pci_con_dev.tstc = pci_con_tstc;
-       device_register (&pci_con_dev);
+       stdio_register (&pci_con_dev);
        printf("PATI ready for PCI connection, type ctrl-c for exit\n");
        do {
                udelay(10);
index d9b0ad3768ddfcd5563d32c34c957f8eeae6f4cd..3d82e047c18964752276b269884f10de975f3edc 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <version.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 #include <sed156x.h>
 
@@ -325,7 +325,7 @@ int phone_getc(void)
 
 int drv_phone_init(void)
 {
-       device_t console_dev;
+       struct stdio_dev console_dev;
 
        console_init();
 
@@ -340,7 +340,7 @@ int drv_phone_init(void)
        console_dev.tstc = phone_tstc;  /* 'tstc' function */
        console_dev.getc = phone_getc;  /* 'getc' function */
 
-       if (device_register(&console_dev) == 0)
+       if (stdio_register(&console_dev) == 0)
                return 1;
 
        return 0;
index 1d48f6d0bc42b8c0eeaa655705e93437855e45cc..853cbde748627f134eaa8773d0c0f6a9ac973eac 100644 (file)
@@ -30,7 +30,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <commproc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <lcd.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -249,18 +249,18 @@ int smc1_tstc(void)
 int drv_keyboard_init(void)
 {
        int error = 0;
-       device_t kbd_dev;
+       struct stdio_dev kbd_dev;
 
        if (0) {
                /* register the keyboard */
-               memset (&kbd_dev, 0, sizeof(device_t));
+               memset (&kbd_dev, 0, sizeof(struct stdio_dev));
                strcpy(kbd_dev.name, "kbd");
                kbd_dev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
                kbd_dev.putc = NULL;
                kbd_dev.puts = NULL;
                kbd_dev.getc = smc1_getc;
                kbd_dev.tstc = smc1_tstc;
-               error = device_register (&kbd_dev);
+               error = stdio_register (&kbd_dev);
        } else {
                lcd_is_enabled = 0;
                lcd_disable();
index 37d3aa48e7415aa75a911ba87961c5fdfcd9badc..e5ca4abe47445e8bcf11e001c724121620fd5f4d 100644 (file)
@@ -36,7 +36,7 @@
 #include <version.h>
 #include <stdarg.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <s3c2400.h>
 
 DECLARE_GLOBAL_DATA_PTR;
index c8a997b0a4799284e0546a690bbf54dd03abadcd..f90e5dd2c3091f4d428c8bf4529fcb79c6be9394 100644 (file)
@@ -32,7 +32,6 @@ COBJS-y += main.o
 COBJS-y += circbuf.o
 COBJS-y += console.o
 COBJS-y += command.o
-COBJS-y += devices.o
 COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
@@ -40,6 +39,7 @@ COBJS-y += image.o
 COBJS-y += memsize.o
 COBJS-y += s_record.o
 COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
+COBJS-y += stdio.o
 COBJS-y += xyzModem.o
 
 # core command
index f861f8300cee13eb37a354040f2bd5a96f109c6c..178fbfeaa897854a22b1a38d2ec17d9dadeff2b0 100644 (file)
  */
 #include <common.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
        int l;
-       struct list_head *list = device_get_list();
+       struct list_head *list = stdio_get_list();
        struct list_head *pos;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        /* Scan for valid output and input devices */
 
        puts ("List of available devices:\n");
 
        list_for_each(pos, list) {
-               dev = list_entry(pos, device_t, list);
+               dev = list_entry(pos, struct stdio_dev, list);
 
                printf ("%-8s %08x %c%c%c ",
                        dev->name,
index d422d9f924645c78dcee351406b0f6cb0cd1bda2..3653fe1a1ef914cb6a52b50960fe9bd22e554d47 100644 (file)
@@ -42,7 +42,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <post.h>
 #include <logbuff.h>
 
@@ -142,7 +142,7 @@ void logbuff_reset (void)
 
 int drv_logbuff_init (void)
 {
-       device_t logdev;
+       struct stdio_dev logdev;
        int rc;
 
        /* Device initialization */
@@ -154,7 +154,7 @@ int drv_logbuff_init (void)
        logdev.putc  = logbuff_putc;            /* 'putc' function */
        logdev.puts  = logbuff_puts;            /* 'puts' function */
 
-       rc = device_register (&logdev);
+       rc = stdio_register (&logdev);
 
        return (rc == 0) ? 1 : rc;
 }
index fd3dd4851480969f968b190d6e00b2e4df304cc4..60ec378b3c93a40eea63025d9af2506dd09d3df9 100644 (file)
  */
 #include <common.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <serial.h>
 
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
        int last_tilde = 0;
-       device_t *dev = NULL;
+       struct stdio_dev *dev = NULL;
 
        if (argc < 1)
                return -1;
 
        /* Scan for selected output/input device */
-       dev = device_get_by_name(argv[1]);
+       dev = stdio_get_by_name(argv[1]);
        if (!dev)
                return -1;
 
index 2add047880ea63a5fec679f8e18d0c3e1f5abc2d..0a36d2fedfe9aad7b10481908ad41ac2b39b22ae 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <stdarg.h>
 #include <malloc.h>
-#include <console.h>
+#include <stdio_dev.h>
 #include <exports.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -48,7 +48,7 @@ extern int overwrite_console(void);
 
 #endif /* CONFIG_SYS_CONSOLE_IS_IN_ENV */
 
-static int console_setfile(int file, device_t * dev)
+static int console_setfile(int file, struct stdio_dev * dev)
 {
        int error = 0;
 
@@ -96,8 +96,8 @@ static int console_setfile(int file, device_t * dev)
 #if defined(CONFIG_CONSOLE_MUX)
 /** Console I/O multiplexing *******************************************/
 
-static device_t *tstcdev;
-device_t **console_devices[MAX_FILES];
+static struct stdio_dev *tstcdev;
+struct stdio_dev **console_devices[MAX_FILES];
 int cd_count[MAX_FILES];
 
 /*
@@ -119,7 +119,7 @@ static int console_getc(int file)
 static int console_tstc(int file)
 {
        int i, ret;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        disable_ctrlc(1);
        for (i = 0; i < cd_count[file]; i++) {
@@ -141,7 +141,7 @@ static int console_tstc(int file)
 static void console_putc(int file, const char c)
 {
        int i;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        for (i = 0; i < cd_count[file]; i++) {
                dev = console_devices[file][i];
@@ -153,7 +153,7 @@ static void console_putc(int file, const char c)
 static void console_puts(int file, const char *s)
 {
        int i;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        for (i = 0; i < cd_count[file]; i++) {
                dev = console_devices[file][i];
@@ -167,7 +167,7 @@ static inline void console_printdevs(int file)
        iomux_printdevs(file);
 }
 
-static inline void console_doenv(int file, device_t *dev)
+static inline void console_doenv(int file, struct stdio_dev *dev)
 {
        iomux_doenv(file, dev->name);
 }
@@ -197,7 +197,7 @@ static inline void console_printdevs(int file)
        printf("%s\n", stdio_devices[file]->name);
 }
 
-static inline void console_doenv(int file, device_t *dev)
+static inline void console_doenv(int file, struct stdio_dev *dev)
 {
        console_setfile(file, dev);
 }
@@ -479,11 +479,11 @@ inline void dbg(const char *fmt, ...)
 
 /** U-Boot INIT FUNCTIONS *************************************************/
 
-device_t *search_device(int flags, char *name)
+struct stdio_dev *search_device(int flags, char *name)
 {
-       device_t *dev;
+       struct stdio_dev *dev;
 
-       dev = device_get_by_name(name);
+       dev = stdio_get_by_name(name);
 
        if (dev && (dev->flags & flags))
                return dev;
@@ -494,7 +494,7 @@ device_t *search_device(int flags, char *name)
 int console_assign(int file, char *devname)
 {
        int flag;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        /* Check for valid file */
        switch (file) {
@@ -537,7 +537,7 @@ int console_init_f(void)
 int console_init_r(void)
 {
        char *stdinname, *stdoutname, *stderrname;
-       device_t *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
+       struct stdio_dev *inputdev = NULL, *outputdev = NULL, *errdev = NULL;
 #ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
        int i;
 #endif /* CONFIG_SYS_CONSOLE_ENV_OVERWRITE */
@@ -645,11 +645,11 @@ done:
 /* Called after the relocation - use desired console functions */
 int console_init_r(void)
 {
-       device_t *inputdev = NULL, *outputdev = NULL;
+       struct stdio_dev *inputdev = NULL, *outputdev = NULL;
        int i;
-       struct list_head *list = device_get_list();
+       struct list_head *list = stdio_get_list();
        struct list_head *pos;
-       device_t *dev;
+       struct stdio_dev *dev;
 
 #ifdef CONFIG_SPLASH_SCREEN
        /*
@@ -662,7 +662,7 @@ int console_init_r(void)
 
        /* Scan devices looking for input and output devices */
        list_for_each(pos, list) {
-               dev = list_entry(pos, device_t, list);
+               dev = list_entry(pos, struct stdio_dev, list);
 
                if ((dev->flags & DEV_FLAGS_INPUT) && (inputdev == NULL)) {
                        inputdev = dev;
index bdcc853ff07bc70a71bcfa776d0974f85cb8bf2b..91d98e98358ca3dee517d96c507fa43adb8206dc 100644 (file)
@@ -29,7 +29,7 @@
 void iomux_printdevs(const int console)
 {
        int i;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        for (i = 0; i < cd_count[console]; i++) {
                dev = console_devices[console][i];
@@ -43,8 +43,8 @@ int iomux_doenv(const int console, const char *arg)
 {
        char *console_args, *temp, **start;
        int i, j, k, io_flag, cs_idx, repeat;
-       device_t *dev;
-       device_t **cons_set;
+       struct stdio_dev *dev;
+       struct stdio_dev **cons_set;
 
        console_args = strdup(arg);
        if (console_args == NULL)
@@ -85,7 +85,7 @@ int iomux_doenv(const int console, const char *arg)
                *temp = '\0';
                start[i] = temp + 1;
        }
-       cons_set = (device_t **)calloc(i, sizeof(device_t *));
+       cons_set = (struct stdio_dev **)calloc(i, sizeof(struct stdio_dev *));
        if (cons_set == NULL) {
                free(start);
                free(console_args);
@@ -158,14 +158,14 @@ int iomux_doenv(const int console, const char *arg)
        } else {
                /* Works even if console_devices[console] is NULL. */
                console_devices[console] =
-                       (device_t **)realloc(console_devices[console],
-                       cs_idx * sizeof(device_t *));
+                       (struct stdio_dev **)realloc(console_devices[console],
+                       cs_idx * sizeof(struct stdio_dev *));
                if (console_devices[console] == NULL) {
                        free(cons_set);
                        return 1;
                }
                memcpy(console_devices[console], cons_set, cs_idx *
-                       sizeof(device_t *));
+                       sizeof(struct stdio_dev *));
 
                cd_count[console] = cs_idx;
        }
index b9a698d5c405756e6951cd69397847d755a6f8dd..c87de0beff40cea7baa51b6a60f62b4399705d33 100644 (file)
@@ -34,7 +34,7 @@
 #include <command.h>
 #include <stdarg.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #if defined(CONFIG_POST)
 #include <post.h>
 #endif
@@ -355,7 +355,7 @@ static void test_pattern (void)
 
 int drv_lcd_init (void)
 {
-       device_t lcddev;
+       struct stdio_dev lcddev;
        int rc;
 
        lcd_base = (void *)(gd->fb_base);
@@ -373,7 +373,7 @@ int drv_lcd_init (void)
        lcddev.putc  = lcd_putc;                /* 'putc' function */
        lcddev.puts  = lcd_puts;                /* 'puts' function */
 
-       rc = device_register (&lcddev);
+       rc = stdio_register (&lcddev);
 
        return (rc == 0) ? 1 : rc;
 }
index 5d0a73ce0605d3a245f9fedd0d1ded22e45dfd7f..41a24c2fadc666f148ec4dabd69c559dbc572c48 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <serial.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -142,9 +142,9 @@ void serial_initialize (void)
        serial_assign (default_serial_console ()->name);
 }
 
-void serial_devices_init (void)
+void serial_stdio_init (void)
 {
-       device_t dev;
+       struct stdio_dev dev;
        struct serial_device *s = serial_devices;
 
        while (s) {
@@ -159,7 +159,7 @@ void serial_devices_init (void)
                dev.getc = s->getc;
                dev.tstc = s->tstc;
 
-               device_register (&dev);
+               stdio_register (&dev);
 
                s = s->next;
        }
similarity index 84%
rename from common/devices.c
rename to common/stdio.c
index ba53c9bbec4cc1e627749b6f2ce9ad1efe01ab6c..697df5a495081a703b11d420ae68db7fcec9721d 100644 (file)
@@ -25,7 +25,7 @@
 #include <common.h>
 #include <stdarg.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <serial.h>
 #ifdef CONFIG_LOGBUFFER
 #include <logbuff.h>
@@ -36,8 +36,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static device_t devs;
-device_t *stdio_devices[] = { NULL, NULL, NULL };
+static struct stdio_dev devs;
+struct stdio_dev *stdio_devices[] = { NULL, NULL, NULL };
 char *stdio_names[MAX_FILES] = { "stdin", "stdout", "stderr" };
 
 #if defined(CONFIG_SPLASH_SCREEN) && !defined(CONFIG_SYS_DEVICE_NULLDEV)
@@ -70,7 +70,7 @@ int nulldev_input(void)
 
 static void drv_system_init (void)
 {
-       device_t dev;
+       struct stdio_dev dev;
 
        memset (&dev, 0, sizeof (dev));
 
@@ -88,7 +88,7 @@ static void drv_system_init (void)
        dev.tstc = serial_tstc;
 #endif
 
-       device_register (&dev);
+       stdio_register (&dev);
 
 #ifdef CONFIG_SYS_DEVICE_NULLDEV
        memset (&dev, 0, sizeof (dev));
@@ -100,7 +100,7 @@ static void drv_system_init (void)
        dev.getc = nulldev_input;
        dev.tstc = nulldev_input;
 
-       device_register (&dev);
+       stdio_register (&dev);
 #endif
 }
 
@@ -108,21 +108,21 @@ static void drv_system_init (void)
  * DEVICES
  **************************************************************************
  */
-struct list_head* device_get_list(void)
+struct list_head* stdio_get_list(void)
 {
        return &(devs.list);
 }
 
-device_t* device_get_by_name(char* name)
+struct stdio_dev* stdio_get_by_name(char* name)
 {
        struct list_head *pos;
-       device_t *dev;
+       struct stdio_dev *dev;
 
        if(!name)
                return NULL;
 
        list_for_each(pos, &(devs.list)) {
-               dev = list_entry(pos, device_t, list);
+               dev = list_entry(pos, struct stdio_dev, list);
                if(strcmp(dev->name, name) == 0)
                        return dev;
        }
@@ -130,29 +130,29 @@ device_t* device_get_by_name(char* name)
        return NULL;
 }
 
-device_t* device_clone(device_t *dev)
+struct stdio_dev* stdio_clone(struct stdio_dev *dev)
 {
-       device_t *_dev;
+       struct stdio_dev *_dev;
 
        if(!dev)
                return NULL;
 
-       _dev = calloc(1, sizeof(device_t));
+       _dev = calloc(1, sizeof(struct stdio_dev));
 
        if(!_dev)
                return NULL;
 
-       memcpy(_dev, dev, sizeof(device_t));
+       memcpy(_dev, dev, sizeof(struct stdio_dev));
        strncpy(_dev->name, dev->name, 16);
 
        return _dev;
 }
 
-int device_register (device_t * dev)
+int stdio_register (struct stdio_dev * dev)
 {
-       device_t *_dev;
+       struct stdio_dev *_dev;
 
-       _dev = device_clone(dev);
+       _dev = stdio_clone(dev);
        if(!_dev)
                return -1;
        list_add_tail(&(_dev->list), &(devs.list));
@@ -162,15 +162,15 @@ int device_register (device_t * dev)
 /* deregister the device "devname".
  * returns 0 if success, -1 if device is assigned and 1 if devname not found
  */
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
-int device_deregister(char *devname)
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+int stdio_deregister(char *devname)
 {
        int l;
        struct list_head *pos;
-       device_t *dev;
+       struct stdio_dev *dev;
        char temp_names[3][8];
 
-       dev = device_get_by_name(devname);
+       dev = stdio_get_by_name(devname);
 
        if(!dev) /* device not found */
                return -1;
@@ -189,7 +189,7 @@ int device_deregister(char *devname)
 
        /* reassign Device list */
        list_for_each(pos, &(devs.list)) {
-               dev = list_entry(pos, device_t, list);
+               dev = list_entry(pos, struct stdio_dev, list);
                for (l=0 ; l< MAX_FILES; l++) {
                        if(strcmp(dev->name, temp_names[l]) == 0)
                                stdio_devices[l] = dev;
@@ -197,9 +197,9 @@ int device_deregister(char *devname)
        }
        return 0;
 }
-#endif /* CONFIG_SYS_DEVICE_DEREGISTER */
+#endif /* CONFIG_SYS_STDIO_DEREGISTER */
 
-int devices_init (void)
+int stdio_init (void)
 {
 #ifndef CONFIG_ARM     /* already relocated for current ARM implementation */
        ulong relocation_offset = gd->reloc_off;
@@ -235,7 +235,7 @@ int devices_init (void)
 #endif
        drv_system_init ();
 #ifdef CONFIG_SERIAL_MULTI
-       serial_devices_init ();
+       serial_stdio_init ();
 #endif
 #ifdef CONFIG_USB_TTY
        drv_usbtty_init ();
index e0d006c322d6953a8a301803cf4dd40b14254e4c..b458d77283a2497ebe1c86f31d20af5a9ed6f3d7 100644 (file)
@@ -25,7 +25,7 @@
  *
  */
 #include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <asm/byteorder.h>
 
 #include <usb.h>
@@ -153,7 +153,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);
 int drv_usb_kbd_init(void)
 {
        int error,i;
-       device_t usb_kbd_dev,*old_dev;
+       struct stdio_dev usb_kbd_dev,*old_dev;
        struct usb_device *dev;
        char *stdinname  = getenv ("stdin");
 
@@ -168,7 +168,7 @@ int drv_usb_kbd_init(void)
                        if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
                                /* check, if it is already registered */
                                USB_KBD_PRINTF("USB KBD found set up device.\n");
-                               old_dev = device_get_by_name(DEVNAME);
+                               old_dev = stdio_get_by_name(DEVNAME);
                                if(old_dev) {
                                        /* ok, already registered, just return ok */
                                        USB_KBD_PRINTF("USB KBD is already registered.\n");
@@ -176,7 +176,7 @@ int drv_usb_kbd_init(void)
                                }
                                /* register the keyboard */
                                USB_KBD_PRINTF("USB KBD register.\n");
-                               memset (&usb_kbd_dev, 0, sizeof(device_t));
+                               memset (&usb_kbd_dev, 0, sizeof(struct stdio_dev));
                                strcpy(usb_kbd_dev.name, DEVNAME);
                                usb_kbd_dev.flags =  DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
                                usb_kbd_dev.putc = NULL;
@@ -184,7 +184,7 @@ int drv_usb_kbd_init(void)
                                usb_kbd_dev.getc = usb_kbd_getc;
                                usb_kbd_dev.tstc = usb_kbd_testc;
                                usb_kbd_dev.priv = (void *)dev;
-                               error = device_register (&usb_kbd_dev);
+                               error = stdio_register (&usb_kbd_dev);
                                if(error==0) {
                                        /* check if this is the standard input device */
                                        if(strcmp(stdinname,DEVNAME)==0) {
@@ -212,8 +212,8 @@ int drv_usb_kbd_init(void)
 /* deregistering the keyboard */
 int usb_kbd_deregister(void)
 {
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
-       return device_deregister(DEVNAME);
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+       return stdio_deregister(DEVNAME);
 #else
        return 1;
 #endif
index c995d962dc0a386ae669e4b1367ff5cc36e86549..1cd619f10b02d016cab184a1d63d00feccff53ea 100644 (file)
@@ -7,7 +7,7 @@
  */
 
 #include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <asm/blackfin.h>
 
 #ifndef CONFIG_JTAG_CONSOLE_TIMEOUT
@@ -105,7 +105,7 @@ static int jtag_getc(void)
 
 int drv_jtag_console_init(void)
 {
-       device_t dev;
+       struct stdio_dev dev;
        int ret;
 
        memset(&dev, 0x00, sizeof(dev));
@@ -116,7 +116,7 @@ int drv_jtag_console_init(void)
        dev.tstc = jtag_tstc;
        dev.getc = jtag_getc;
 
-       ret = device_register(&dev);
+       ret = stdio_register(&dev);
        return (ret == 0 ? 1 : ret);
 }
 
index 70849ee21bbefa3df47a8519a870dc531e3a1bda..691451afcbf6a027854ba15c5d324b622c779e67 100644 (file)
@@ -31,7 +31,7 @@
 #include "../../board/freescale/common/fsl_diu_fb.h"
 
 #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
-#include <devices.h>
+#include <stdio_dev.h>
 #include <video_fb.h>
 #endif
 
index 4474e24e26a50fc1cbf2d93f5ad8f9d473c6b4c6..4b88b21b3f0cae1247389bd3cb59f64f28cc91a0 100644 (file)
@@ -35,7 +35,7 @@
 #include <stdarg.h>
 #include <lcdvideo.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #if defined(CONFIG_POST)
 #include <post.h>
 #endif
index 4a59927436c34ce372aba8bac3e6dd67c91fa128..c79c499b6fa378fb6919d28b8c6743ae6a03df8b 100644 (file)
@@ -36,7 +36,7 @@
 #include <timestamp.h>
 #include <i2c.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 #ifdef CONFIG_VIDEO
 
@@ -1287,7 +1287,7 @@ int drv_video_init (void)
 {
        int error, devices = 1;
 
-       device_t videodev;
+       struct stdio_dev videodev;
 
        video_init ((void *)(gd->fb_base));     /* Video initialization */
 
@@ -1301,7 +1301,7 @@ int drv_video_init (void)
        videodev.putc = video_putc;     /* 'putc' function */
        videodev.puts = video_puts;     /* 'puts' function */
 
-       error = device_register (&videodev);
+       error = stdio_register (&videodev);
 
        return (error == 0) ? devices : error;
 }
index 97efcb6dfcac5fccb909be389ec1faa36e26f68f..d56c5f099f09155c7f3d03361b12dffe91428ad5 100644 (file)
@@ -32,7 +32,7 @@
 #include <version.h>
 #include <stdarg.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <lcd.h>
 #include <asm/arch/pxa-regs.h>
 
index 512b9f28c4c126b3f1fc73a2ff54096dbbf7cb90..a5fbd5f5095db5a174dd461a3beb27f9c8a368a2 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <common.h>
 
-#include <devices.h>
+#include <stdio_dev.h>
 #include <keyboard.h>
 
 #undef KBG_DEBUG
@@ -268,7 +268,7 @@ extern int overwrite_console (void);
 int kbd_init (void)
 {
        int error;
-       device_t kbddev ;
+       struct stdio_dev kbddev ;
        char *stdinname  = getenv ("stdin");
 
        if(kbd_init_hw()==-1)
@@ -281,7 +281,7 @@ int kbd_init (void)
        kbddev.getc = kbd_getc ;
        kbddev.tstc = kbd_testc ;
 
-       error = device_register (&kbddev);
+       error = stdio_register (&kbddev);
        if(error==0) {
                /* check if this is the standard input device */
                if(strcmp(stdinname,DEVNAME)==0) {
index b2ee5eaba498635c45bc272a423933c4477e95a1..f5329a594e8c2d7367ddf37ab30ae230e42dff3a 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <net.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -243,7 +243,7 @@ int nc_tstc (void)
 
 int drv_nc_init (void)
 {
-       device_t dev;
+       struct stdio_dev dev;
        int rc;
 
        memset (&dev, 0, sizeof (dev));
@@ -256,7 +256,7 @@ int drv_nc_init (void)
        dev.getc = nc_getc;
        dev.tstc = nc_tstc;
 
-       rc = device_register (&dev);
+       rc = stdio_register (&dev);
 
        return (rc == 0) ? 1 : rc;
 }
index dca73b93d0024ea185ac16586c6e56a1a5575dab..7b5ecb5132d0de3bd5c508448579caea717104e0 100644 (file)
@@ -27,7 +27,7 @@
  */
 
 #include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 #if defined(CONFIG_CPU_V6)
 /*
@@ -148,7 +148,7 @@ int arm_dcc_tstc(void)
 }
 
 #ifdef CONFIG_ARM_DCC_MULTI
-static device_t arm_dcc_dev;
+static struct stdio_dev arm_dcc_dev;
 
 int drv_arm_dcc_init(void)
 {
@@ -165,6 +165,6 @@ int drv_arm_dcc_init(void)
        arm_dcc_dev.putc = arm_dcc_putc;        /* 'putc' function */
        arm_dcc_dev.puts = arm_dcc_puts;        /* 'puts' function */
 
-       return device_register(&arm_dcc_dev);
+       return stdio_register(&arm_dcc_dev);
 }
 #endif
index f711d0b18b1a967877698d271bd5a4fff915fab6..cffd5a2b25259d5018274b7144dec6ed40c34acc 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <config.h>
 #include <circbuf.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include "usbtty.h"
 #include "usb_cdc_acm.h"
 #include "usbdescriptors.h"
@@ -70,7 +70,7 @@ static circbuf_t usbtty_output;
 /*
  * Instance variables
  */
-static device_t usbttydev;
+static struct stdio_dev usbttydev;
 static struct usb_device_instance device_instance[1];
 static struct usb_bus_instance bus_instance[1];
 static struct usb_configuration_instance config_instance[NUM_CONFIGS];
@@ -570,7 +570,7 @@ int drv_usbtty_init (void)
        usbttydev.putc = usbtty_putc;   /* 'putc' function */
        usbttydev.puts = usbtty_puts;   /* 'puts' function */
 
-       rc = device_register (&usbttydev);
+       rc = stdio_register (&usbttydev);
 
        return (rc == 0) ? 1 : rc;
 }
index 19d978b245a0f82367d9fa2fa2c53085e6a63be7..4ca94cb31771a35a30ac82ced89a839025b6bfb8 100644 (file)
@@ -801,7 +801,7 @@ int submit_int_msg(struct usb_device *dev, unsigned long pipe,
  */
 void usb_event_poll()
 {
-       device_t *dev;
+       struct stdio_dev *dev;
        struct usb_device *usb_kbd_dev;
        struct usb_interface_descriptor *iface;
        struct usb_endpoint_descriptor *ep;
@@ -809,7 +809,7 @@ void usb_event_poll()
        int maxp;
 
        /* Get the pointer to USB Keyboard device pointer */
-       dev = device_get_by_name("usbkbd");
+       dev = stdio_get_by_name("usbkbd");
        usb_kbd_dev = (struct usb_device *)dev->priv;
        iface = &usb_kbd_dev->config.if_desc[0];
        ep = &iface->ep_desc[0];
index b7f571d03771753895b473c41af8b4cacfe03a60..17e9091a0aa7228cf00e5eb8556d10aeb0fa425d 100644 (file)
@@ -26,7 +26,7 @@
 
 #include "musb_core.h"
 #ifdef CONFIG_USB_KEYBOARD
-#include <devices.h>
+#include <stdio_dev.h>
 extern unsigned char new[];
 #endif
 
index 6adce19984e65273521ac5eb1042d08fdac64cf4..fbc4df9f69c964a385eadc87c3584eeecd526e27 100644 (file)
@@ -183,7 +183,7 @@ CONFIG_VIDEO_HW_CURSOR:          - Uses the hardware cursor capability of the
 
 #include <version.h>
 #include <linux/types.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <video_font.h>
 
 #if defined(CONFIG_CMD_DATE)
@@ -1378,7 +1378,7 @@ int board_video_skip(void) __attribute__((weak, alias("__board_video_skip")));
 int drv_video_init (void)
 {
        int skip_dev_init;
-       device_t console_dev;
+       struct stdio_dev console_dev;
 
        /* Check if video initialization should be skipped */
        if (board_video_skip())
@@ -1412,7 +1412,7 @@ int drv_video_init (void)
        console_dev.getc = VIDEO_GETC_FCT;      /* 'getc' function */
 #endif /* CONFIG_VGA_AS_SINGLE_DEVICE */
 
-       if (device_register (&console_dev) != 0)
+       if (stdio_register (&console_dev) != 0)
                return 0;
 
        /* Return success */
index fe04f27a17abfc9495addd3d1e1d0cd6b09e007f..0dfb23b310bd8caaae26be662d8d90f94fe6cd5f 100644 (file)
 #define CONFIG_USB_UHCI                1
 #define CONFIG_USB_STORAGE     1
 #define CONFIG_USB_KEYBOARD    1
-#define CONFIG_SYS_DEVICE_DEREGISTER   1 /* needed by CONFIG_USB_KEYBOARD */
+#define CONFIG_SYS_STDIO_DEREGISTER    1 /* needed by CONFIG_USB_KEYBOARD */
 
 /*
  * Autoboot stuff
index 8315cfe62ba2194414967a7ba801f41b9aca7524..da9b1cfff628639b0b566e6b971815988c85b55e 100644 (file)
 #define CONFIG_USB_STORAGE
 
 /* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER           /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER            /* needs stdio_deregister */
 #endif
 /************************************************************
  * Debug support
index 2f40ef48c9066a935f34f22a2ba9ee278b1f9421..a3b5c7c3d3dd90057700d704afe1b19f18c9d9a6 100644 (file)
 #define CONFIG_PCI_OHCI                1
 #define CONFIG_USB_OHCI_NEW            1
 #define CONFIG_USB_KEYBOARD    1
-#define CONFIG_SYS_DEVICE_DEREGISTER
+#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL      1
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME  "ohci_pci"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 15
index 60ce0f3aca35bcc47e5abfa136f88f03f9b41cda..955ac3dfa6b24035e34349c956950739dbd032c1 100644 (file)
@@ -391,7 +391,7 @@ extern unsigned long get_board_sys_clk(unsigned long dummy);
 #define CONFIG_PCI_OHCI                        1
 #define CONFIG_USB_OHCI_NEW            1
 #define CONFIG_USB_KEYBOARD            1
-#define CONFIG_SYS_DEVICE_DEREGISTER
+#define CONFIG_SYS_STDIO_DEREGISTER
 #define CONFIG_SYS_USB_EVENT_POLL              1
 #define CONFIG_SYS_USB_OHCI_SLOT_NAME          "ohci_pci"
 #define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS     15
index e214d70a58080dd3f14b5324f8c634acac2b4229..e301599b8a993e806dffe0b424aa49460b1cfdd2 100644 (file)
 #define CONFIG_USB_STORAGE
 
 /* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER           /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER            /* needs stdio_deregister */
 
 /************************************************************
  * Debug support
index de3092d1c6bd7cb6b6ff7425af7a9bd65978cf96..7edea6a0478bbf6547e6ae2b72ae0e6c50337b9b 100644 (file)
 #define CONFIG_DOS_PARTITION   1
 
 /* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER           /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER            /* needs stdio_deregister */
 
 /************************************************************
  * RTC
index 6f58bac91f212360f9df8bbe800787be60d688e1..7b0a08ff01ded013c6daa93c0c4c3537337dbf0c 100644 (file)
@@ -87,7 +87,7 @@
 #define CONFIG_CMD_USB
 #define CONFIG_USB_STORAGE
 /* Enable needed helper functions */
-#define CONFIG_SYS_DEVICE_DEREGISTER   /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER    /* needs stdio_deregister */
 #endif
 
 /*
index 3225ce714ced3ff003e46d174ccfc62af4eb7c91..ac678d0b608ea2fd56c1a956d651bad3b88909e5 100644 (file)
 #define CONFIG_SYS_MAXARGS             32              /* max number of command args */
 #define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
 
-#define CONFIG_SYS_DEVICE_DEREGISTER           /* needs device_deregister */
+#define CONFIG_SYS_STDIO_DEREGISTER           /* needs stdio_deregister */
 
 #define CONFIG_SYS_HZ 1000
 #define CONFIG_SYS_HZ_CLOCK (AT91C_MASTER_CLOCK/2)     /* AT91C_TC0_CMR is implicitly set to */
diff --git a/include/console.h b/include/console.h
deleted file mode 100644 (file)
index bc8b139..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * (C) Copyright 2000
- * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
- *
- * See file CREDITS for list of people who contributed to this
- * project.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
- * MA 02111-1307 USA
- */
-
-#ifndef _CONSOLE_H_
-#define _CONSOLE_H_
-
-#include <devices.h>
-
-/*
-** VARIABLES
-*/
-
-extern device_t        *stdio_devices[] ;
-extern char *stdio_names[MAX_FILES] ;
-
-#endif
index 257c1f761271d61ef4bb4910597823a2c2ab57ae..e38a81e77509c881ec20abfb1a9968ae84ce7d50 100644 (file)
@@ -24,7 +24,7 @@
 #ifndef _IO_MUX_H
 #define _IO_MUX_H
 
-#include <devices.h>
+#include <stdio_dev.h>
 
 /*
  * Stuff required to support console multiplexing.
@@ -34,7 +34,7 @@
  * Pointers to devices used for each file type.  Defined in console.c
  * but storage is allocated in iomux.c.
  */
-extern device_t **console_devices[MAX_FILES];
+extern struct stdio_dev **console_devices[MAX_FILES];
 /*
  * The count of devices assigned to each FILE.  Defined in console.c
  * and populated in iomux.c.
@@ -43,6 +43,6 @@ extern int cd_count[MAX_FILES];
 
 int iomux_doenv(const int, const char *);
 void iomux_printdevs(const int);
-device_t *search_device(int, char *);
+struct stdio_dev *search_device(int, char *);
 
 #endif /* _IO_MUX_H */
index 5722337269b591d8f068890c533ba53fce5800bd..821b58399d27ea91e55f4e246f53553195b1be49 100644 (file)
@@ -55,7 +55,7 @@ extern struct serial_device serial_btuart_device;
 extern struct serial_device serial_stuart_device;
 
 extern void serial_initialize(void);
-extern void serial_devices_init(void);
+extern void serial_stdio_init(void);
 extern int serial_assign(char * name);
 extern void serial_reinit_all(void);
 
similarity index 85%
rename from include/devices.h
rename to include/stdio_dev.h
index 3a9881bf0498c8ed1acc13fe6ad1bb1d4545a236..8b06ccf005a28c52968f0c023e319b70d4036756 100644 (file)
@@ -12,7 +12,7 @@
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
  * MA 02111-1307 USA
  */
 
-#include <linux/list.h>
+#ifndef _STDIO_DEV_H_
+#define _STDIO_DEV_H_
 
-#ifndef _DEVICES_H_
-#define _DEVICES_H_
+#include <linux/list.h>
 
 /*
- * CONSOLE DEVICES
+ * STDIO DEVICES
  */
 
 #define DEV_FLAGS_INPUT         0x00000001     /* Device can be used as input  console */
@@ -36,7 +36,7 @@
 #define DEV_EXT_VIDEO   0x00000001     /* Video extensions supported           */
 
 /* Device information */
-typedef struct {
+struct stdio_dev {
        int     flags;                  /* Device flags: input/output/system    */
        int     ext;                    /* Supported extensions                 */
        char    name[16];               /* Device name                          */
@@ -60,7 +60,7 @@ typedef struct {
 
        void *priv;                     /* Private extensions                   */
        struct list_head list;
-} device_t;
+};
 
 /*
  * VIDEO EXTENSIONS
@@ -83,20 +83,20 @@ typedef struct {
 /*
  * VARIABLES
  */
-extern device_t *stdio_devices[];
+extern struct stdio_dev *stdio_devices[];
 extern char *stdio_names[MAX_FILES];
 
 /*
  * PROTOTYPES
  */
-int    device_register (device_t * dev);
-int    devices_init (void);
-#ifdef CONFIG_SYS_DEVICE_DEREGISTER
-int    device_deregister(char *devname);
+int    stdio_register (struct stdio_dev * dev);
+int    stdio_init (void);
+#ifdef CONFIG_SYS_STDIO_DEREGISTER
+int    stdio_deregister(char *devname);
 #endif
-struct list_head* device_get_list(void);
-device_t* device_get_by_name(char* name);
-device_t* device_clone(device_t *dev);
+struct list_head* stdio_get_list(void);
+struct stdio_dev* stdio_get_by_name(char* name);
+struct stdio_dev* stdio_clone(struct stdio_dev *dev);
 
 #ifdef CONFIG_ARM_DCC_MULTI
 int drv_arm_dcc_init(void);
@@ -123,4 +123,4 @@ int drv_nc_init (void);
 int drv_jtag_console_init (void);
 #endif
 
-#endif /* _DEVICES_H_ */
+#endif
index 566ae1660e7a83de502b02034c129640064c665b..a44d308f6728c631d92a9a886e62996ca86d9a3b 100644 (file)
@@ -41,7 +41,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <timestamp.h>
 #include <version.h>
 #include <net.h>
@@ -389,7 +389,7 @@ void start_armboot (void)
        /* IP Address */
        gd->bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
 
-       devices_init ();        /* get the devices list going. */
+       stdio_init ();  /* get the devices list going. */
 
        jumptable_init ();
 
index 57115df09bf8bc954bc89796892f7eb18b60160a..5b2d0ef1d3767835b64e1cd34d10f6102ad14b40 100644 (file)
@@ -22,7 +22,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <timestamp.h>
 #include <version.h>
 #include <net.h>
@@ -350,7 +350,7 @@ void board_init_r(gd_t *new_gd, ulong dest_addr)
 
        bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
 
-       devices_init();
+       stdio_init();
        jumptable_init();
        console_init_r();
 
index 047f16418f8aa4c1c067e71198e9afd3bc836a53..28de372b78f3305509b0fb7de9242bc6fb5b7790 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <common.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <environment.h>
 #include <malloc.h>
 #include <net.h>
@@ -354,8 +354,8 @@ void board_init_r(gd_t * id, ulong dest_addr)
        /* relocate environment function pointers etc. */
        env_relocate();
 
-       /* Initialize devices */
-       devices_init();
+       /* Initialize stdio devices */
+       stdio_init();
        jumptable_init();
 
        /* Initialize the console (after the relocation and devices init) */
index 35ccd3cd74303552359fe861cfdf26cb82aa4249..faf6b96ba2745dd31c2755ed0842293edb943ea6 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include <common.h>
-#include <console.h>
+#include <stdio_dev.h>
 #include <watchdog.h>
 #include <post.h>
 
index e18dfa5bc4483dbf4092d7806b4a75ed5b992400..54ef6e75a835543c4735a1fc2cbdbc2b6ad9fafa 100644 (file)
@@ -31,7 +31,7 @@
 #include <common.h>
 #include <watchdog.h>
 #include <command.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <timestamp.h>
 #include <version.h>
 #include <malloc.h>
@@ -299,7 +299,7 @@ void start_i386boot (void)
        show_boot_progress(0x27);
 
 
-       devices_init ();
+       stdio_init ();
 
        jumptable_init ();
 
index cd894573828910bea45204b33215dbc6bdcfbcd2..c58ed104cc8a3129a083312b06c9528f96c9d09b 100644 (file)
@@ -23,7 +23,7 @@
 
 #include <common.h>
 #include <pci.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <i8042.h>
 #include <asm/ptrace.h>
 #include <asm/realmode.h>
@@ -168,8 +168,8 @@ int video_init(void)
 {
        u16 pos;
 
-       static device_t vga_dev;
-       static device_t kbd_dev;
+       static struct stdio_dev vga_dev;
+       static struct stdio_dev kbd_dev;
 
        vidmem = (char *) 0xb8000;
        vidport = 0x3d4;
@@ -203,7 +203,7 @@ int video_init(void)
        vga_dev.tstc  = NULL;              /* 'tstc' function */
        vga_dev.getc  = NULL;              /* 'getc' function */
 
-       if (device_register(&vga_dev) == 0) {
+       if (stdio_register(&vga_dev) == 0) {
            return 1;
        }
 
@@ -220,7 +220,7 @@ int video_init(void)
        kbd_dev.tstc  = i8042_tstc;  /* 'tstc' function */
        kbd_dev.getc  = i8042_getc;  /* 'getc' function */
 
-       if (device_register(&kbd_dev) == 0) {
+       if (stdio_register(&kbd_dev) == 0) {
            return 1;
        }
        return 0;
index 7d4ffc779c4c094b46a1f403a94bfad56d0c5778..f73a46ccead942edf9b5325368bb958c9f682caf 100644 (file)
@@ -28,7 +28,7 @@
 #include <watchdog.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 
 #include <asm/immap.h>
 
@@ -595,8 +595,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 
        /** leave this here (after malloc(), environment and PCI are working) **/
-       /* Initialize devices */
-       devices_init ();
+       /* Initialize stdio devices */
+       stdio_init ();
 
        /* Initialize the jump table for applications */
        jumptable_init ();
index f8ac234d10884bc4a8f75dd9445ce9498466e99e..aa5b1295ce24d3f8dba3f294e68a548c36c29591 100644 (file)
@@ -24,7 +24,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <timestamp.h>
 #include <version.h>
 #include <net.h>
@@ -411,8 +411,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 
 /** leave this here (after malloc(), environment and PCI are working) **/
-       /* Initialize devices */
-       devices_init ();
+       /* Initialize stdio devices */
+       stdio_init ();
 
        jumptable_init ();
 
index 9d8eea796245b8a9714d468d12f9b98d02ef2735..cd234578b7474cb16e74ddfae70592d882ea1e83 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <watchdog.h>
 #include <net.h>
 #ifdef CONFIG_STATUS_LED
@@ -155,7 +155,7 @@ void board_init (void)
        bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
 
        WATCHDOG_RESET ();
-       devices_init();
+       stdio_init();
        jumptable_init();
        console_init_r();
        /*
index 0677e999952ac82994c91215e8e4a7099cd6dc55..b142c59613796fa894088d7b6f69508aa60071eb 100644 (file)
@@ -25,7 +25,7 @@
  */
 
 #include <common.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <watchdog.h>
 #include <net.h>
 #ifdef CONFIG_STATUS_LED
@@ -161,7 +161,7 @@ void board_init (void)
        bd->bi_ip_addr = getenv_IPaddr ("ipaddr");
 
        WATCHDOG_RESET ();
-       devices_init();
+       stdio_init();
        jumptable_init();
        console_init_r();
 
index 155171d6b12fdfc47637f813eace6d3742e02141..6dd4d56ff32f9813e2a087a3d0c8ee43acd8917f 100644 (file)
@@ -25,7 +25,7 @@
 #include <watchdog.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #ifdef CONFIG_8xx
 #include <mpc8xx.h>
 #endif
@@ -932,8 +932,8 @@ void board_init_r (gd_t *id, ulong dest_addr)
 #endif
 
 /** leave this here (after malloc(), environment and PCI are working) **/
-       /* Initialize devices */
-       devices_init ();
+       /* Initialize stdio devices */
+       stdio_init ();
 
        /* Initialize the jump table for applications */
        jumptable_init ();
index 183110fe30b42b15d89c71a41bc5376b121d4206..829455d8b12fa031b0801b64aa2b6443529877fe 100644 (file)
@@ -21,7 +21,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <timestamp.h>
 #include <version.h>
 #include <watchdog.h>
@@ -150,7 +150,7 @@ init_fnc_t *init_sequence[] =
        sh_flash_init,  /* Flash memory(NOR) init*/
        INIT_FUNC_NAND_INIT/* Flash memory (NAND) init */
        INIT_FUNC_PCI_INIT      /* PCI init */
-       devices_init,
+       stdio_init,
        console_init_r,
        interrupt_init,
 #ifdef BOARD_LATE_INIT
index 628d46d3085e3600535923274c83ae97190d9039..d40834b7b02cfb5094664bff804acaaeb584c0a7 100644 (file)
@@ -28,7 +28,7 @@
 #include <common.h>
 #include <command.h>
 #include <malloc.h>
-#include <devices.h>
+#include <stdio_dev.h>
 #include <config.h>
 #if defined(CONFIG_CMD_IDE)
 #include <ide.h>
@@ -402,8 +402,8 @@ void board_init_f(ulong bootflag)
        pci_init();
 #endif
 
-       /* Initialize devices */
-       devices_init();
+       /* Initialize stdio devices */
+       stdio_init();
 
        /* Initialize the jump table for applications */
        jumptable_init();
index c982e27fff1f54e3e8b2bb2b73b21b130b837e55..bc8114e511357c18c45c072564d7303d511d69c5 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include <common.h>
-#include <console.h>
+#include <stdio_dev.h>
 #include <watchdog.h>
 #include <post.h>