linux/drivers/isdn/hardware/eicon/di_defs.h
<<
>>
Prefs
   1
   2/*
   3 *
   4 Copyright (c) Eicon Networks, 2002.
   5 *
   6 This source file is supplied for the use with
   7 Eicon Networks range of DIVA Server Adapters.
   8 *
   9 Eicon File Revision :    2.1
  10 *
  11 This program is free software; you can redistribute it and/or modify
  12 it under the terms of the GNU General Public License as published by
  13 the Free Software Foundation; either version 2, or (at your option)
  14 any later version.
  15 *
  16 This program is distributed in the hope that it will be useful,
  17 but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  18 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  19 See the GNU General Public License for more details.
  20 *
  21 You should have received a copy of the GNU General Public License
  22 along with this program; if not, write to the Free Software
  23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  24 *
  25 */
  26#ifndef _DI_DEFS_
  27#define _DI_DEFS_
  28/* typedefs for our data structures                         */
  29typedef struct get_name_s GET_NAME;
  30/*  The entity_s structure is used to pass all
  31    parameters between application and IDI   */
  32typedef struct entity_s ENTITY;
  33typedef struct buffers_s BUFFERS;
  34typedef struct postcall_s POSTCALL;
  35typedef struct get_para_s GET_PARA;
  36#define BOARD_NAME_LENGTH 9
  37#define IDI_CALL_LINK_T
  38#define IDI_CALL_ENTITY_T
  39/* typedef void ( * IDI_CALL)(ENTITY *); */
  40/* --------------------------------------------------------
  41   IDI_CALL
  42   -------------------------------------------------------- */
  43typedef void (IDI_CALL_LINK_T *IDI_CALL)(ENTITY IDI_CALL_ENTITY_T *);
  44typedef struct {
  45        word length;          /* length of data/parameter field           */
  46        byte P[270];          /* data/parameter field                     */
  47} DBUFFER;
  48struct get_name_s {
  49        word command;         /* command = 0x0100 */
  50        byte name[BOARD_NAME_LENGTH];
  51};
  52struct postcall_s {
  53        word      command;                           /* command = 0x0300 */
  54        word      dummy;                             /* not used */
  55        void      (*callback)(void *);      /* call back */
  56        void      *context;                          /* context pointer */
  57};
  58#define REQ_PARA            0x0600   /* request command line parameters */
  59#define REQ_PARA_LEN             1   /* number of data bytes */
  60#define L1_STARTUP_DOWN_POS      0   /* '-y' command line parameter in......*/
  61#define L1_STARTUP_DOWN_MSK   0x01   /* first byte position (index 0) with value 0x01 */
  62struct get_para_s {
  63        word  command;            /* command = 0x0600 */
  64        byte  len;                /* max length of para field in bytes */
  65        byte  para[REQ_PARA_LEN]; /* parameter field */
  66};
  67struct buffers_s {
  68        word PLength;
  69        byte *P;
  70};
  71struct entity_s {
  72        byte                  Req;            /* pending request          */
  73        byte                  Rc;             /* return code received     */
  74        byte                  Ind;            /* indication received      */
  75        byte                  ReqCh;          /* channel of current Req   */
  76        byte                  RcCh;           /* channel of current Rc    */
  77        byte                  IndCh;          /* channel of current Ind   */
  78        byte                  Id;             /* ID used by this entity   */
  79        byte                  GlobalId;       /* reserved field           */
  80        byte                  XNum;           /* number of X-buffers      */
  81        byte                  RNum;           /* number of R-buffers      */
  82        BUFFERS               *X;             /* pointer to X-buffer list */
  83        BUFFERS               *R;             /* pointer to R-buffer list */
  84        word                  RLength;        /* length of current R-data */
  85        DBUFFER               *RBuffer;       /* buffer of current R-data */
  86        byte                  RNR;            /* receive not ready flag   */
  87        byte                  complete;       /* receive complete status  */
  88        IDI_CALL              callback;
  89        word                  user[2];
  90        /* fields used by the driver internally                     */
  91        byte                  No;             /* entity number            */
  92        byte                  reserved2;      /* reserved field           */
  93        byte                  More;           /* R/X More flags           */
  94        byte                  MInd;           /* MDATA coding for this ID */
  95        byte                  XCurrent;       /* current transmit buffer  */
  96        byte                  RCurrent;       /* current receive buffer   */
  97        word                  XOffset;        /* offset in x-buffer       */
  98        word                  ROffset;        /* offset in r-buffer       */
  99};
 100typedef struct {
 101        byte                  type;
 102        byte                  channels;
 103        word                  features;
 104        IDI_CALL              request;
 105} DESCRIPTOR;
 106/* descriptor type field coding */
 107#define IDI_ADAPTER_S           1
 108#define IDI_ADAPTER_PR          2
 109#define IDI_ADAPTER_DIVA        3
 110#define IDI_ADAPTER_MAESTRA     4
 111#define IDI_VADAPTER            0x40
 112#define IDI_DRIVER              0x80
 113#define IDI_DADAPTER            0xfd
 114#define IDI_DIDDPNP             0xfe
 115#define IDI_DIMAINT             0xff
 116/* Hardware IDs ISA PNP */
 117#define HW_ID_DIVA_PRO     3    /* same as IDI_ADAPTER_DIVA    */
 118#define HW_ID_MAESTRA      4    /* same as IDI_ADAPTER_MAESTRA */
 119#define HW_ID_PICCOLA      5
 120#define HW_ID_DIVA_PRO20   6
 121#define HW_ID_DIVA20       7
 122#define HW_ID_DIVA_PRO20_U 8
 123#define HW_ID_DIVA20_U     9
 124#define HW_ID_DIVA30       10
 125#define HW_ID_DIVA30_U     11
 126/* Hardware IDs PCI */
 127#define HW_ID_EICON_PCI              0x1133
 128#define HW_ID_SIEMENS_PCI            0x8001 /* unused SubVendor ID for Siemens Cornet-N cards */
 129#define HW_ID_PROTTYPE_CORNETN       0x0014 /* SubDevice ID for Siemens Cornet-N cards */
 130#define HW_ID_FUJITSU_SIEMENS_PCI    0x110A /* SubVendor ID for Fujitsu Siemens */
 131#define HW_ID_GS03_PCI               0x0021 /* SubDevice ID for Fujitsu Siemens ISDN S0 card */
 132#define HW_ID_DIVA_PRO20_PCI         0xe001
 133#define HW_ID_DIVA20_PCI             0xe002
 134#define HW_ID_DIVA_PRO20_PCI_U       0xe003
 135#define HW_ID_DIVA20_PCI_U           0xe004
 136#define HW_ID_DIVA201_PCI            0xe005
 137#define HW_ID_DIVA_CT_ST             0xe006
 138#define HW_ID_DIVA_CT_U              0xe007
 139#define HW_ID_DIVA_CTL_ST            0xe008
 140#define HW_ID_DIVA_CTL_U             0xe009
 141#define HW_ID_DIVA_ISDN_V90_PCI      0xe00a
 142#define HW_ID_DIVA202_PCI_ST         0xe00b
 143#define HW_ID_DIVA202_PCI_U          0xe00c
 144#define HW_ID_DIVA_PRO30_PCI         0xe00d
 145#define HW_ID_MAESTRA_PCI            0xe010
 146#define HW_ID_MAESTRAQ_PCI           0xe012
 147#define HW_ID_DSRV_Q8M_V2_PCI        0xe013
 148#define HW_ID_MAESTRAP_PCI           0xe014
 149#define HW_ID_DSRV_P30M_V2_PCI       0xe015
 150#define HW_ID_DSRV_VOICE_Q8M_PCI     0xe016
 151#define HW_ID_DSRV_VOICE_Q8M_V2_PCI  0xe017
 152#define HW_ID_DSRV_B2M_V2_PCI        0xe018
 153#define HW_ID_DSRV_VOICE_P30M_V2_PCI 0xe019
 154#define HW_ID_DSRV_B2F_PCI           0xe01a
 155#define HW_ID_DSRV_VOICE_B2M_V2_PCI  0xe01b
 156/* Hardware IDs USB */
 157#define EICON_USB_VENDOR_ID          0x071D
 158#define HW_ID_DIVA_USB_REV1          0x1000
 159#define HW_ID_DIVA_USB_REV2          0x1003
 160#define HW_ID_TELEDAT_SURF_USB_REV2  0x1004
 161#define HW_ID_TELEDAT_SURF_USB_REV1  0x2000
 162/* --------------------------------------------------------------------------
 163   Adapter array change notification framework
 164   -------------------------------------------------------------------------- */
 165typedef void (IDI_CALL_LINK_T *didd_adapter_change_callback_t)(void IDI_CALL_ENTITY_T *context, DESCRIPTOR *adapter, int removal);
 166/* -------------------------------------------------------------------------- */
 167#define DI_VOICE          0x0 /* obsolete define */
 168#define DI_FAX3           0x1
 169#define DI_MODEM          0x2
 170#define DI_POST           0x4
 171#define DI_V110           0x8
 172#define DI_V120           0x10
 173#define DI_POTS           0x20
 174#define DI_CODEC          0x40
 175#define DI_MANAGE         0x80
 176#define DI_V_42           0x0100
 177#define DI_EXTD_FAX       0x0200 /* Extended FAX (ECM, 2D, T.6, Polling) */
 178#define DI_AT_PARSER      0x0400 /* Build-in AT Parser in the L2 */
 179#define DI_VOICE_OVER_IP  0x0800 /* Voice over IP support */
 180typedef void (IDI_CALL_LINK_T *_IDI_CALL)(void *, ENTITY *);
 181#endif
 182