cycx_cfm.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * cycx_cfm.h Cyclom 2X WAN Link Driver.
  3. * Definitions for the Cyclom 2X Firmware Module (CFM).
  4. *
  5. * Author: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
  6. *
  7. * Copyright: (c) 1998-2003 Arnaldo Carvalho de Melo
  8. *
  9. * Based on sdlasfm.h by Gene Kozin <74604.152@compuserve.com>
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version
  14. * 2 of the License, or (at your option) any later version.
  15. * ============================================================================
  16. * 1998/08/08 acme Initial version.
  17. */
  18. #ifndef _CYCX_CFM_H
  19. #define _CYCX_CFM_H
  20. /* Defines */
  21. #define CFM_VERSION 2
  22. #define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module"
  23. /* min/max */
  24. #define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */
  25. #define CFM_DESCR_LEN 256 /* max length of description string */
  26. #define CFM_MAX_CYCX 1 /* max number of compatible adapters */
  27. #define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */
  28. /* Firmware Commands */
  29. #define GEN_POWER_ON 0x1280
  30. #define GEN_SET_SEG 0x1401 /* boot segment setting. */
  31. #define GEN_BOOT_DAT 0x1402 /* boot data. */
  32. #define GEN_START 0x1403 /* board start. */
  33. #define GEN_DEFPAR 0x1404 /* buffer length for boot. */
  34. /* Adapter Types */
  35. #define CYCX_2X 2
  36. /* for now only the 2X is supported, no plans to support 8X or 16X */
  37. #define CYCX_8X 8
  38. #define CYCX_16X 16
  39. #define CFID_X25_2X 5200
  40. /**
  41. * struct cycx_fw_info - firmware module information.
  42. * @codeid - firmware ID
  43. * @version - firmware version number
  44. * @adapter - compatible adapter types
  45. * @memsize - minimum memory size
  46. * @reserved - reserved
  47. * @startoffs - entry point offset
  48. * @winoffs - dual-port memory window offset
  49. * @codeoffs - code load offset
  50. * @codesize - code size
  51. * @dataoffs - configuration data load offset
  52. * @datasize - configuration data size
  53. */
  54. struct cycx_fw_info {
  55. unsigned short codeid;
  56. unsigned short version;
  57. unsigned short adapter[CFM_MAX_CYCX];
  58. unsigned long memsize;
  59. unsigned short reserved[2];
  60. unsigned short startoffs;
  61. unsigned short winoffs;
  62. unsigned short codeoffs;
  63. unsigned long codesize;
  64. unsigned short dataoffs;
  65. unsigned long datasize;
  66. };
  67. /**
  68. * struct cycx_firmware - CYCX firmware file structure
  69. * @signature - CFM file signature
  70. * @version - file format version
  71. * @checksum - info + image
  72. * @reserved - reserved
  73. * @descr - description string
  74. * @info - firmware module info
  75. * @image - code image (variable size)
  76. */
  77. struct cycx_firmware {
  78. char signature[80];
  79. unsigned short version;
  80. unsigned short checksum;
  81. unsigned short reserved[6];
  82. char descr[CFM_DESCR_LEN];
  83. struct cycx_fw_info info;
  84. unsigned char image[0];
  85. };
  86. struct cycx_fw_header {
  87. unsigned long reset_size;
  88. unsigned long data_size;
  89. unsigned long code_size;
  90. };
  91. #endif /* _CYCX_CFM_H */