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-2000 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 21 /* Defines */ 22 23 #define CFM_VERSION 2 24 #define CFM_SIGNATURE "CFM - Cyclades CYCX Firmware Module" 25 26 /* min/max */ 27 #define CFM_IMAGE_SIZE 0x20000 /* max size of CYCX code image file */ 28 #define CFM_DESCR_LEN 256 /* max length of description string */ 29 #define CFM_MAX_CYCX 1 /* max number of compatible adapters */ 30 #define CFM_LOAD_BUFSZ 0x400 /* buffer size for reset code (buffer_load) */ 31 32 /* Firmware Commands */ 33 #define GEN_POWER_ON 0x1280 34 35 #define GEN_SET_SEG 0x1401 /* boot segment setting. */ 36 #define GEN_BOOT_DAT 0x1402 /* boot data. */ 37 #define GEN_START 0x1403 /* board start. */ 38 #define GEN_DEFPAR 0x1404 /* buffer length for boot. */ 39 40 /* Adapter Types */ 41 #define CYCX_2X 2 42 /* for now only the 2X is supported, no plans to support 8X or 16X */ 43 #define CYCX_8X 8 44 #define CYCX_16X 16 45 46 #define CFID_X25_2X 5200 47 48 /* Data Types */ 49 50 typedef struct cfm_info /* firmware module information */ 51 { 52 unsigned short codeid; /* firmware ID */ 53 unsigned short version; /* firmware version number */ 54 unsigned short adapter[CFM_MAX_CYCX]; /* compatible adapter types */ 55 unsigned long memsize; /* minimum memory size */ 56 unsigned short reserved[2]; /* reserved */ 57 unsigned short startoffs; /* entry point offset */ 58 unsigned short winoffs; /* dual-port memory window offset */ 59 unsigned short codeoffs; /* code load offset */ 60 unsigned long codesize; /* code size */ 61 unsigned short dataoffs; /* configuration data load offset */ 62 unsigned long datasize; /* configuration data size */ 63 } cfm_info_t; 64 65 typedef struct cfm /* CYCX firmware file structure */ 66 { 67 char signature[80]; /* CFM file signature */ 68 unsigned short version; /* file format version */ 69 unsigned short checksum; /* info + image */ 70 unsigned short reserved[6]; /* reserved */ 71 char descr[CFM_DESCR_LEN]; /* description string */ 72 cfm_info_t info; /* firmware module info */ 73 unsigned char image[1]; /* code image (variable size) */ 74 } cfm_t; 75 76 typedef struct cycx_header_s { 77 unsigned long reset_size; 78 unsigned long data_size; 79 unsigned long code_size; 80 } cycx_header_t; 81 82 #endif /* _CYCX_CFM_H */ 83