cycx_cfm.h 2.9 KB

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