add SDHC support in mmc driver
[u-boot-openmoko/mini2440.git] / include / xyzModem.h
blobf437bbd0bdf8254cd90f9cf0b4f67693023bbf23
1 /*
2 *==========================================================================
4 * xyzModem.h
6 * RedBoot stream handler for xyzModem protocol
8 *==========================================================================
9 *####ECOSGPLCOPYRIGHTBEGIN####
10 * -------------------------------------------
11 * This file is part of eCos, the Embedded Configurable Operating System.
12 * Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
13 * Copyright (C) 2002 Gary Thomas
15 * eCos is free software; you can redistribute it and/or modify it under
16 * the terms of the GNU General Public License as published by the Free
17 * Software Foundation; either version 2 or (at your option) any later version.
19 * eCos is distributed in the hope that it will be useful, but WITHOUT ANY
20 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 * for more details.
24 * You should have received a copy of the GNU General Public License along
25 * with eCos; if not, write to the Free Software Foundation, Inc.,
26 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 * As a special exception, if other files instantiate templates or use macros
29 * or inline functions from this file, or you compile this file and link it
30 * with other works to produce a work based on this file, this file does not
31 * by itself cause the resulting work to be covered by the GNU General Public
32 * License. However the source code for this file must still be made available
33 * in accordance with section (3) of the GNU General Public License.
35 * This exception does not invalidate any other reasons why a work based on
36 * this file might be covered by the GNU General Public License.
38 * Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
39 * at http: *sources.redhat.com/ecos/ecos-license/
40 * -------------------------------------------
41 *####ECOSGPLCOPYRIGHTEND####
42 *==========================================================================
43 *#####DESCRIPTIONBEGIN####
45 * Author(s): gthomas
46 * Contributors: gthomas
47 * Date: 2000-07-14
48 * Purpose:
49 * Description:
51 * This code is part of RedBoot (tm).
53 *####DESCRIPTIONEND####
55 *==========================================================================
58 #ifndef _XYZMODEM_H_
59 #define _XYZMODEM_H_
61 #define xyzModem_xmodem 1
62 #define xyzModem_ymodem 2
63 /* Don't define this until the protocol support is in place */
64 /*#define xyzModem_zmodem 3 */
66 #define xyzModem_access -1
67 #define xyzModem_noZmodem -2
68 #define xyzModem_timeout -3
69 #define xyzModem_eof -4
70 #define xyzModem_cancel -5
71 #define xyzModem_frame -6
72 #define xyzModem_cksum -7
73 #define xyzModem_sequence -8
75 #define xyzModem_close 1
76 #define xyzModem_abort 2
79 #ifdef REDBOOT
80 extern getc_io_funcs_t xyzModem_io;
81 #else
82 #define CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT
83 #define CYGACC_CALL_IF_SET_CONSOLE_COMM(x)
85 #define diag_vprintf vprintf
86 #define diag_printf printf
87 #define diag_vsprintf vsprintf
89 #define CYGACC_CALL_IF_DELAY_US(x) udelay(x)
91 typedef struct {
92 char *filename;
93 int mode;
94 int chan;
95 #ifdef CYGPKG_REDBOOT_NETWORKING
96 struct sockaddr_in *server;
97 #endif
98 } connection_info_t;
100 #ifndef BOOL_WAS_DEFINED
101 #define BOOL_WAS_DEFINED
102 typedef unsigned int bool;
103 #endif
105 #define false 0
106 #define true 1
108 #endif
111 int xyzModem_stream_open(connection_info_t *info, int *err);
112 void xyzModem_stream_close(int *err);
113 void xyzModem_stream_terminate(bool method, int (*getc)(void));
114 int xyzModem_stream_read(char *buf, int size, int *err);
115 char *xyzModem_error(int err);
117 #endif /* _XYZMODEM_H_ */