xyzModem.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*
  2. *==========================================================================
  3. *
  4. * xyzModem.h
  5. *
  6. * RedBoot stream handler for xyzModem protocol
  7. *
  8. *==========================================================================
  9. * SPDX-License-Identifier: eCos-2.0
  10. *==========================================================================
  11. *#####DESCRIPTIONBEGIN####
  12. *
  13. * Author(s): gthomas
  14. * Contributors: gthomas
  15. * Date: 2000-07-14
  16. * Purpose:
  17. * Description:
  18. *
  19. * This code is part of RedBoot (tm).
  20. *
  21. *####DESCRIPTIONEND####
  22. *
  23. *==========================================================================
  24. */
  25. #ifndef _XYZMODEM_H_
  26. #define _XYZMODEM_H_
  27. #define xyzModem_xmodem 1
  28. #define xyzModem_ymodem 2
  29. /* Don't define this until the protocol support is in place */
  30. /*#define xyzModem_zmodem 3 */
  31. #define xyzModem_access -1
  32. #define xyzModem_noZmodem -2
  33. #define xyzModem_timeout -3
  34. #define xyzModem_eof -4
  35. #define xyzModem_cancel -5
  36. #define xyzModem_frame -6
  37. #define xyzModem_cksum -7
  38. #define xyzModem_sequence -8
  39. #define xyzModem_close 1
  40. #define xyzModem_abort 2
  41. #ifdef REDBOOT
  42. extern getc_io_funcs_t xyzModem_io;
  43. #else
  44. #define CYGNUM_CALL_IF_SET_COMM_ID_QUERY_CURRENT
  45. #define CYGACC_CALL_IF_SET_CONSOLE_COMM(x)
  46. #define diag_vprintf vprintf
  47. #define diag_printf printf
  48. #define diag_vsprintf vsprintf
  49. #define CYGACC_CALL_IF_DELAY_US(x) udelay(x)
  50. typedef struct {
  51. char *filename;
  52. int mode;
  53. int chan;
  54. #ifdef CYGPKG_REDBOOT_NETWORKING
  55. struct sockaddr_in *server;
  56. #endif
  57. } connection_info_t;
  58. #endif
  59. int xyzModem_stream_open(connection_info_t *info, int *err);
  60. void xyzModem_stream_close(int *err);
  61. void xyzModem_stream_terminate(bool method, int (*getc)(void));
  62. int xyzModem_stream_read(char *buf, int size, int *err);
  63. char *xyzModem_error(int err);
  64. #endif /* _XYZMODEM_H_ */