eicon_isa.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:5k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /* $Id: eicon_isa.h,v 1.1.4.1 2001/11/20 14:19:35 kai Exp $
  2.  *
  3.  * ISDN low-level module for Eicon active ISDN-Cards.
  4.  *
  5.  * Copyright 1998      by Fritz Elfert (fritz@isdn4linux.de)
  6.  * Copyright 1998-2000 by Armin Schindler (mac@melware.de)
  7.  * Copyright 1999,2000 Cytronics & Melware (info@melware.de)
  8.  *
  9.  * This software may be used and distributed according to the terms
  10.  * of the GNU General Public License, incorporated herein by reference.
  11.  *
  12.  */
  13. #ifndef eicon_isa_h
  14. #define eicon_isa_h
  15. #ifdef __KERNEL__
  16. #include <linux/config.h>
  17. /* Factory defaults for ISA-Cards */
  18. #define EICON_ISA_MEMBASE 0xd0000
  19. #define EICON_ISA_IRQ     3
  20. /* shmem offset for Quadro parts */
  21. #define EICON_ISA_QOFFSET 0x0800
  22. typedef struct {
  23.         __u16 length __attribute__ ((packed));   /* length of data/parameter field         */
  24.         __u8  P[270];                            /* data/parameter field                   */
  25. } eicon_scom_PBUFFER;
  26. /* General communication buffer */
  27. typedef struct {
  28.         __u8   Req;                                /* request register                       */
  29. __u8   ReqId;                              /* request task/entity identification     */
  30. __u8   Rc;                                 /* return code register                   */
  31. __u8   RcId;                               /* return code task/entity identification */
  32. __u8   Ind;                                /* Indication register                    */
  33. __u8   IndId;                              /* Indication task/entity identification  */
  34. __u8   IMask;                              /* Interrupt Mask Flag                    */
  35. __u8   RNR;                                /* Receiver Not Ready (set by PC)         */
  36. __u8   XLock;                              /* XBuffer locked Flag                    */
  37. __u8   Int;                                /* ISDN interrupt                         */
  38. __u8   ReqCh;                              /* Channel field for layer-3 Requests     */
  39. __u8   RcCh;                               /* Channel field for layer-3 Returncodes  */
  40. __u8   IndCh;                              /* Channel field for layer-3 Indications  */
  41. __u8   MInd;                               /* more data indication field             */
  42. __u16  MLength;                            /* more data total packet length          */
  43. __u8   ReadyInt;                           /* request field for ready interrupt      */
  44. __u8   Reserved[12];                       /* reserved space                         */
  45. __u8   IfType;                             /* 1 = 16k-Interface                      */
  46. __u16  Signature __attribute__ ((packed)); /* ISDN adapter Signature                 */
  47. eicon_scom_PBUFFER XBuffer;                /* Transmit Buffer                        */
  48. eicon_scom_PBUFFER RBuffer;                /* Receive Buffer                         */
  49. } eicon_isa_com;
  50. /* struct for downloading firmware */
  51. typedef struct {
  52. __u8  ctrl;
  53. __u8  card;
  54. __u8  msize;
  55. __u8  fill0;
  56. __u16 ebit __attribute__ ((packed));
  57. __u32 eloc __attribute__ ((packed));
  58. __u8  reserved[20];
  59. __u16 signature __attribute__ ((packed));
  60. __u8  fill[224];
  61. __u8  b[256];
  62. } eicon_isa_boot;
  63. /* Shared memory */
  64. typedef union {
  65. unsigned char  c[0x400];
  66. eicon_isa_com  com;
  67. eicon_isa_boot boot;
  68. } eicon_isa_shmem;
  69. /*
  70.  * card's description
  71.  */
  72. typedef struct {
  73. int               ramsize;
  74. int               irq;     /* IRQ                        */
  75. unsigned long   physmem;  /* physical memory address   */
  76. #ifdef CONFIG_MCA
  77. int   io;     /* IO-port for MCA brand      */
  78. #endif /* CONFIG_MCA */
  79. void*             card;
  80. eicon_isa_shmem*  shmem;    /* Shared-memory area         */
  81. unsigned char*    intack;   /* Int-Acknowledge            */
  82. unsigned char*    stopcpu;  /* Writing here stops CPU     */
  83. unsigned char*    startcpu; /* Writing here starts CPU    */
  84. unsigned char     type;     /* card type                  */
  85. int   channels; /* No. of channels   */
  86. unsigned char     irqprobe; /* Flag: IRQ-probing          */
  87. unsigned char     mvalid;   /* Flag: Memory is valid      */
  88. unsigned char     ivalid;   /* Flag: IRQ is valid         */
  89. unsigned char     master;   /* Flag: Card ist Quadro 1/4  */
  90. } eicon_isa_card;
  91. /* Offsets for special locations on standard cards */
  92. #define INTACK     0x03fe 
  93. #define STOPCPU    0x0400
  94. #define STARTCPU   0x0401
  95. #define RAMSIZE    0x0400
  96. /* Offsets for special location on PRI card */
  97. #define INTACK_P   0x3ffc
  98. #define STOPCPU_P  0x3ffe
  99. #define STARTCPU_P 0x3fff
  100. #define RAMSIZE_P  0x4000
  101. extern int eicon_isa_load(eicon_isa_card *card, eicon_isa_codebuf *cb);
  102. extern int eicon_isa_bootload(eicon_isa_card *card, eicon_isa_codebuf *cb);
  103. extern void eicon_isa_release(eicon_isa_card *card);
  104. extern void eicon_isa_printpar(eicon_isa_card *card);
  105. extern void eicon_isa_transmit(eicon_isa_card *card);
  106. extern int eicon_isa_find_card(int Mem, int Irq, char * Id);
  107. #endif  /* __KERNEL__ */
  108. #endif /* eicon_isa_h */