hysdn_pof.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* $Id: hysdn_pof.h,v 1.2.6.1 2001/09/23 22:24:54 kai Exp $
  2. *
  3. * Linux driver for HYSDN cards, definitions used for handling pof-files.
  4. *
  5. * Author Werner Cornelius (werner@titro.de) for Hypercope GmbH
  6. * Copyright 1999 by Werner Cornelius (werner@titro.de)
  7. *
  8. * This software may be used and distributed according to the terms
  9. * of the GNU General Public License, incorporated herein by reference.
  10. *
  11. */
  12. /************************/
  13. /* POF specific defines */
  14. /************************/
  15. #define BOOT_BUF_SIZE 0x1000 /* =4096, maybe moved to other h file */
  16. #define CRYPT_FEEDTERM 0x8142
  17. #define CRYPT_STARTTERM 0x81a5
  18. /* max. timeout time in seconds
  19. * from end of booting to POF is ready
  20. */
  21. #define POF_READY_TIME_OUT_SEC 10
  22. /**********************************/
  23. /* defines for 1.stage boot image */
  24. /**********************************/
  25. /* the POF file record containing the boot loader image
  26. * has 2 pages a 16KB:
  27. * 1. page contains the high 16-bit part of the 32-bit E1 words
  28. * 2. page contains the low 16-bit part of the 32-bit E1 words
  29. *
  30. * In each 16KB page we assume the start of the boot loader code
  31. * in the highest 2KB part (at offset 0x3800);
  32. * the rest (0x0000..0x37FF) is assumed to contain 0 bytes.
  33. */
  34. #define POF_BOOT_LOADER_PAGE_SIZE 0x4000 /* =16384U */
  35. #define POF_BOOT_LOADER_TOTAL_SIZE (2U * POF_BOOT_LOADER_PAGE_SIZE)
  36. #define POF_BOOT_LOADER_CODE_SIZE 0x0800 /* =2KB =2048U */
  37. /* offset in boot page, where loader code may start */
  38. /* =0x3800= 14336U */
  39. #define POF_BOOT_LOADER_OFF_IN_PAGE (POF_BOOT_LOADER_PAGE_SIZE-POF_BOOT_LOADER_CODE_SIZE)
  40. /*--------------------------------------POF file record structs------------*/
  41. typedef struct PofFileHdr_tag { /* Pof file header */
  42. /*00 */ unsigned long Magic __attribute__((packed));
  43. /*04 */ unsigned long N_PofRecs __attribute__((packed));
  44. /*08 */
  45. } tPofFileHdr;
  46. typedef struct PofRecHdr_tag { /* Pof record header */
  47. /*00 */ unsigned short PofRecId __attribute__((packed));
  48. /*02 */ unsigned long PofRecDataLen __attribute__((packed));
  49. /*06 */
  50. } tPofRecHdr;
  51. typedef struct PofTimeStamp_tag {
  52. /*00 */ unsigned long UnixTime __attribute__((packed));
  53. /*04 */ unsigned char DateTimeText[0x28];
  54. /* =40 */
  55. /*2C */
  56. } tPofTimeStamp;
  57. /* tPofFileHdr.Magic value: */
  58. #define TAGFILEMAGIC 0x464F501AUL
  59. /* tPofRecHdr.PofRecId values: */
  60. #define TAG_ABSDATA 0x1000 /* abs. data */
  61. #define TAG_BOOTDTA 0x1001 /* boot data */
  62. #define TAG_COMMENT 0x0020
  63. #define TAG_SYSCALL 0x0021
  64. #define TAG_FLOWCTRL 0x0022
  65. #define TAG_TIMESTMP 0x0010 /* date/time stamp of version */
  66. #define TAG_CABSDATA 0x1100 /* crypted abs. data */
  67. #define TAG_CBOOTDTA 0x1101 /* crypted boot data */