File: /usr/src/linux/drivers/isdn/hysdn/hysdn_pof.h

1     /* $Id: hysdn_pof.h,v 1.2 2000/11/13 22:51:47 kai Exp $
2     
3      * Linux driver for HYSDN cards, definitions used for handling pof-files.
4      * written by Werner Cornelius (werner@titro.de) for Hypercope GmbH
5      *
6      * Copyright 1999  by Werner Cornelius (werner@titro.de)
7      *
8      * This program is free software; you can redistribute it and/or modify
9      * it under the terms of the GNU General Public License as published by
10      * the Free Software Foundation; either version 2, or (at your option)
11      * any later version.
12      *
13      * This program is distributed in the hope that it will be useful,
14      * but WITHOUT ANY WARRANTY; without even the implied warranty of
15      * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16      * GNU General Public License for more details.
17      *
18      * You should have received a copy of the GNU General Public License
19      * along with this program; if not, write to the Free Software
20      * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21      *
22      */
23     
24     /************************/
25     /* POF specific defines */
26     /************************/
27     #define BOOT_BUF_SIZE   0x1000	/* =4096, maybe moved to other h file */
28     #define CRYPT_FEEDTERM  0x8142
29     #define CRYPT_STARTTERM 0x81a5
30     				    /*  max. timeout time in seconds
31     				     *  from end of booting to POF is ready
32     				     */
33     #define POF_READY_TIME_OUT_SEC  10
34     
35     /**********************************/
36     /* defines for 1.stage boot image */
37     /**********************************/
38     
39     /*  the POF file record containing the boot loader image
40      *  has 2 pages a 16KB:
41      *  1. page contains the high 16-bit part of the 32-bit E1 words
42      *  2. page contains the low  16-bit part of the 32-bit E1 words
43      *
44      *  In each 16KB page we assume the start of the boot loader code
45      *  in the highest 2KB part (at offset 0x3800);
46      *  the rest (0x0000..0x37FF) is assumed to contain 0 bytes.
47      */
48     
49     #define POF_BOOT_LOADER_PAGE_SIZE   0x4000	/* =16384U */
50     #define POF_BOOT_LOADER_TOTAL_SIZE  (2U*POF_BOOT_LOADER_PAGE_SIZE)
51     
52     #define POF_BOOT_LOADER_CODE_SIZE   0x0800	/* =2KB =2048U */
53     
54     		    /* offset in boot page, where loader code may start */
55     					    /* =0x3800= 14336U */
56     #define POF_BOOT_LOADER_OFF_IN_PAGE (POF_BOOT_LOADER_PAGE_SIZE-POF_BOOT_LOADER_CODE_SIZE)
57     
58     
59     /*--------------------------------------POF file record structs------------*/
60     typedef struct PofFileHdr_tag {	/* Pof file header */
61     /*00 */ ulong Magic __attribute__((packed));
62     /*04 */ ulong N_PofRecs __attribute__((packed));
63     /*08 */
64     } tPofFileHdr;
65     
66     typedef struct PofRecHdr_tag {	/* Pof record header */
67     /*00 */ word PofRecId __attribute__((packed));
68     /*02 */ ulong PofRecDataLen __attribute__((packed));
69     /*06 */
70     } tPofRecHdr;
71     
72     typedef struct PofTimeStamp_tag {
73     /*00 */ ulong UnixTime __attribute__((packed));
74     	/*04 */ uchar DateTimeText[0x28] __attribute__((packed));
75     	/* =40 */
76     /*2C */
77     } tPofTimeStamp;
78     
79     				    /* tPofFileHdr.Magic value: */
80     #define TAGFILEMAGIC 0x464F501AUL
81     				    /* tPofRecHdr.PofRecId values: */
82     #define TAG_ABSDATA  0x1000	/* abs. data */
83     #define TAG_BOOTDTA  0x1001	/* boot data */
84     #define TAG_COMMENT  0x0020
85     #define TAG_SYSCALL  0x0021
86     #define TAG_FLOWCTRL 0x0022
87     #define TAG_TIMESTMP 0x0010	/* date/time stamp of version */
88     #define TAG_CABSDATA 0x1100	/* crypted abs. data */
89     #define TAG_CBOOTDTA 0x1101	/* crypted boot data */
90