Path: blob/master/drivers/isdn/hardware/eicon/divasync.h
15115 views
1/*2*3Copyright (c) Eicon Networks, 2002.4*5This source file is supplied for the use with6Eicon Networks range of DIVA Server Adapters.7*8Eicon File Revision : 2.19*10This program is free software; you can redistribute it and/or modify11it under the terms of the GNU General Public License as published by12the Free Software Foundation; either version 2, or (at your option)13any later version.14*15This program is distributed in the hope that it will be useful,16but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY17implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.18See the GNU General Public License for more details.19*20You should have received a copy of the GNU General Public License21along with this program; if not, write to the Free Software22Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.23*24*/25#ifndef __DIVA_SYNC__H26#define __DIVA_SYNC__H27#define IDI_SYNC_REQ_REMOVE 0x0028#define IDI_SYNC_REQ_GET_NAME 0x0129#define IDI_SYNC_REQ_GET_SERIAL 0x0230#define IDI_SYNC_REQ_SET_POSTCALL 0x0331#define IDI_SYNC_REQ_GET_XLOG 0x0432#define IDI_SYNC_REQ_GET_FEATURES 0x0533#define IDI_SYNC_REQ_USB_REGISTER 0x0634#define IDI_SYNC_REQ_USB_RELEASE 0x0735#define IDI_SYNC_REQ_USB_ADD_DEVICE 0x0836#define IDI_SYNC_REQ_USB_START_DEVICE 0x0937#define IDI_SYNC_REQ_USB_STOP_DEVICE 0x0A38#define IDI_SYNC_REQ_USB_REMOVE_DEVICE 0x0B39#define IDI_SYNC_REQ_GET_CARDTYPE 0x0C40#define IDI_SYNC_REQ_GET_DBG_XLOG 0x0D41#define DIVA_USB42#define DIVA_USB_REQ 0xAC43#define DIVA_USB_TEST 0xAB44#define DIVA_USB_ADD_ADAPTER 0xAC45#define DIVA_USB_REMOVE_ADAPTER 0xAD46#define IDI_SYNC_REQ_SERIAL_HOOK 0x8047#define IDI_SYNC_REQ_XCHANGE_STATUS 0x8148#define IDI_SYNC_REQ_USB_HOOK 0x8249#define IDI_SYNC_REQ_PORTDRV_HOOK 0x8350#define IDI_SYNC_REQ_SLI 0x84 /* SLI request from 3signal modem drivers */51#define IDI_SYNC_REQ_RECONFIGURE 0x8552#define IDI_SYNC_REQ_RESET 0x8653#define IDI_SYNC_REQ_GET_85X_DEVICE_DATA 0x8754#define IDI_SYNC_REQ_LOCK_85X 0x8855#define IDI_SYNC_REQ_DIVA_85X_USB_DATA_EXCHANGE 0x9956#define IDI_SYNC_REQ_DIPORT_EXCHANGE_REQ 0x9857#define IDI_SYNC_REQ_GET_85X_EXT_PORT_TYPE 0xA058/******************************************************************************/59#define IDI_SYNC_REQ_XDI_GET_EXTENDED_FEATURES 0x9260/*61To receive XDI features:621. set 'buffer_length_in_bytes' to length of you buffer632. set 'features' to pointer to your buffer643. issue synchronous request to XDI654. Check that feature 'DIVA_XDI_EXTENDED_FEATURES_VALID' is present66after call. This feature does indicate that your request67was processed and XDI does support this synchronous request685. if on return bit 31 (0x80000000) in 'buffer_length_in_bytes' is69set then provided buffer was too small, and bits 30-0 does70contain necessary length of buffer.71in this case only features that do find place in the buffer72are indicated to caller73*/74typedef struct _diva_xdi_get_extended_xdi_features {75dword buffer_length_in_bytes;76byte *features;77} diva_xdi_get_extended_xdi_features_t;78/*79features[0]80*/81#define DIVA_XDI_EXTENDED_FEATURES_VALID 0x0182#define DIVA_XDI_EXTENDED_FEATURE_CMA 0x0283#define DIVA_XDI_EXTENDED_FEATURE_SDRAM_BAR 0x0484#define DIVA_XDI_EXTENDED_FEATURE_CAPI_PRMS 0x0885#define DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC 0x1086#define DIVA_XDI_EXTENDED_FEATURE_RX_DMA 0x2087#define DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA 0x4088#define DIVA_XDI_EXTENDED_FEATURE_WIDE_ID 0x8089#define DIVA_XDI_EXTENDED_FEATURES_MAX_SZ 190/******************************************************************************/91#define IDI_SYNC_REQ_XDI_GET_ADAPTER_SDRAM_BAR 0x9392typedef struct _diva_xdi_get_adapter_sdram_bar {93dword bar;94} diva_xdi_get_adapter_sdram_bar_t;95/******************************************************************************/96#define IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS 0x9497/*98CAPI Parameters will be written in the caller's buffer99*/100typedef struct _diva_xdi_get_capi_parameters {101dword structure_length;102byte flag_dynamic_l1_down;103byte group_optimization_enabled;104} diva_xdi_get_capi_parameters_t;105/******************************************************************************/106#define IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER 0x95107/*108Get logical adapter number, as assigned by XDI109'controller' is starting with zero 'sub' controller number110in case of one adapter that supports multiple interfaces111'controller' is zero for Master adapter (and adapter that supports112only one interface)113*/114typedef struct _diva_xdi_get_logical_adapter_number {115dword logical_adapter_number;116dword controller;117dword total_controllers;118} diva_xdi_get_logical_adapter_number_s_t;119/******************************************************************************/120#define IDI_SYNC_REQ_UP1DM_OPERATION 0x96121/******************************************************************************/122#define IDI_SYNC_REQ_DMA_DESCRIPTOR_OPERATION 0x97123#define IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC 0x01124#define IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE 0x02125typedef struct _diva_xdi_dma_descriptor_operation {126int operation;127int descriptor_number;128void* descriptor_address;129dword descriptor_magic;130} diva_xdi_dma_descriptor_operation_t;131/******************************************************************************/132#define IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY 0x01133#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY 0x02134#define IDI_SYNC_REQ_DIDD_ADD_ADAPTER 0x03135#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER 0x04136#define IDI_SYNC_REQ_DIDD_READ_ADAPTER_ARRAY 0x05137#define IDI_SYNC_REQ_DIDD_GET_CFG_LIB_IFC 0x10138typedef struct _diva_didd_adapter_notify {139dword handle; /* Notification handle */140void * callback;141void * context;142} diva_didd_adapter_notify_t;143typedef struct _diva_didd_add_adapter {144void * descriptor;145} diva_didd_add_adapter_t;146typedef struct _diva_didd_remove_adapter {147IDI_CALL p_request;148} diva_didd_remove_adapter_t;149typedef struct _diva_didd_read_adapter_array {150void * buffer;151dword length;152} diva_didd_read_adapter_array_t;153typedef struct _diva_didd_get_cfg_lib_ifc {154void* ifc;155} diva_didd_get_cfg_lib_ifc_t;156/******************************************************************************/157#define IDI_SYNC_REQ_XDI_GET_STREAM 0x91158#define DIVA_XDI_SYNCHRONOUS_SERVICE 0x01159#define DIVA_XDI_DMA_SERVICE 0x02160#define DIVA_XDI_AUTO_SERVICE 0x03161#define DIVA_ISTREAM_COMPLETE_NOTIFY 0162#define DIVA_ISTREAM_COMPLETE_READ 1163#define DIVA_ISTREAM_COMPLETE_WRITE 2164typedef struct _diva_xdi_stream_interface {165unsigned char Id; /* filled by XDI client */166unsigned char provided_service; /* filled by XDI */167unsigned char requested_service; /* filled by XDI Client */168void* xdi_context; /* filled by XDI */169void* client_context; /* filled by XDI client */170int (*write)(void* context,171int Id,172void* data,173int length,174int final,175byte usr1,176byte usr2);177int (*read)(void* context,178int Id,179void* data,180int max_length,181int* final,182byte* usr1,183byte* usr2);184int (*complete)(void* client_context,185int Id,186int what,187void* data,188int length,189int* final);190} diva_xdi_stream_interface_t;191/******************************************************************************/192/*193* IDI_SYNC_REQ_SERIAL_HOOK - special interface for the DIVA Mobile card194*/195typedef struct196{ unsigned char LineState; /* Modem line state (STATUS_R) */197#define SERIAL_GSM_CELL 0x01 /* GSM or CELL cable attached */198unsigned char CardState; /* PCMCIA card state (0 = down) */199unsigned char IsdnState; /* ISDN layer 1 state (0 = down)*/200unsigned char HookState; /* current logical hook state */201#define SERIAL_ON_HOOK 0x02 /* set in DIVA CTRL_R register */202} SERIAL_STATE;203typedef int ( * SERIAL_INT_CB) (void *Context) ;204typedef int ( * SERIAL_DPC_CB) (void *Context) ;205typedef unsigned char ( * SERIAL_I_SYNC) (void *Context) ;206typedef struct207{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */208unsigned char Req; /* request (must be always 0) */209unsigned char Rc; /* return code (is the request) */210unsigned char Function; /* private function code */211#define SERIAL_HOOK_ATTACH 0x81212#define SERIAL_HOOK_STATUS 0x82213#define SERIAL_HOOK_I_SYNC 0x83214#define SERIAL_HOOK_NOECHO 0x84215#define SERIAL_HOOK_RING 0x85216#define SERIAL_HOOK_DETACH 0x8f217unsigned char Flags; /* function refinements */218/* parameters passed by the ATTACH request */219SERIAL_INT_CB InterruptHandler; /* called on each interrupt */220SERIAL_DPC_CB DeferredHandler; /* called on hook state changes */221void *HandlerContext; /* context for both handlers */222/* return values for both the ATTACH and the STATUS request */223unsigned long IoBase; /* IO port assigned to UART */224SERIAL_STATE State;225/* parameters and return values for the I_SYNC function */226SERIAL_I_SYNC SyncFunction; /* to be called synchronized */227void *SyncContext; /* context for this function */228unsigned char SyncResult; /* return value of function */229} SERIAL_HOOK;230/*231* IDI_SYNC_REQ_XCHANGE_STATUS - exchange the status between IDI and WMP232* IDI_SYNC_REQ_RECONFIGURE - reconfiguration of IDI from WMP233*/234typedef struct235{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */236unsigned char Req; /* request (must be always 0) */237unsigned char Rc; /* return code (is the request) */238#define DRIVER_STATUS_BOOT 0xA1239#define DRIVER_STATUS_INIT_DEV 0xA2240#define DRIVER_STATUS_RUNNING 0xA3241#define DRIVER_STATUS_SHUTDOWN 0xAF242#define DRIVER_STATUS_TRAPPED 0xAE243unsigned char wmpStatus; /* exported by WMP */244unsigned char idiStatus; /* exported by IDI */245unsigned long wizProto ; /* from WMP registry to IDI */246/* the cardtype value is defined by cardtype.h */247unsigned long cardType ; /* from IDI registry to WMP */248unsigned long nt2 ; /* from IDI registry to WMP */249unsigned long permanent ; /* from IDI registry to WMP */250unsigned long stableL2 ; /* from IDI registry to WMP */251unsigned long tei ; /* from IDI registry to WMP */252#define CRC4_MASK 0x00000003253#define L1_TRISTATE_MASK 0x00000004254#define WATCHDOG_MASK 0x00000008255#define NO_ORDER_CHECK_MASK 0x00000010256#define LOW_CHANNEL_MASK 0x00000020257#define NO_HSCX30_MASK 0x00000040258#define SET_BOARD 0x00001000259#define SET_CRC4 0x00030000260#define SET_L1_TRISTATE 0x00040000261#define SET_WATCHDOG 0x00080000262#define SET_NO_ORDER_CHECK 0x00100000263#define SET_LOW_CHANNEL 0x00200000264#define SET_NO_HSCX30 0x00400000265#define SET_MODE 0x00800000266#define SET_PROTO 0x02000000267#define SET_CARDTYPE 0x04000000268#define SET_NT2 0x08000000269#define SET_PERMANENT 0x10000000270#define SET_STABLEL2 0x20000000271#define SET_TEI 0x40000000272#define SET_NUMBERLEN 0x80000000273unsigned long Flag ; /* |31-Type-16|15-Mask-0| */274unsigned long NumberLen ; /* reconfiguration: union is empty */275union {276struct { /* possible reconfiguration, but ... ; SET_BOARD */277unsigned long SerialNumber ;278char *pCardname ; /* di_defs.h: BOARD_NAME_LENGTH */279} board ;280struct { /* reset: need resources */281void * pRawResources ;282void * pXlatResources ;283} res ;284struct { /* reconfiguration: wizProto == PROTTYPE_RBSCAS */285#define GLARE_RESOLVE_MASK 0x00000001286#define DID_MASK 0x00000002287#define BEARER_CAP_MASK 0x0000000c288#define SET_GLARE_RESOLVE 0x00010000289#define SET_DID 0x00020000290#define SET_BEARER_CAP 0x000c0000291unsigned long Flag ; /* |31-Type-16|15-VALUE-0| */292unsigned short DigitTimeout ;293unsigned short AnswerDelay ;294} rbs ;295struct { /* reconfiguration: wizProto == PROTTYPE_QSIG */296#define CALL_REF_LENGTH1_MASK 0x00000001297#define BRI_CHANNEL_ID_MASK 0x00000002298#define SET_CALL_REF_LENGTH 0x00010000299#define SET_BRI_CHANNEL_ID 0x00020000300unsigned long Flag ; /* |31-Type-16|15-VALUE-0| */301} qsig ;302struct { /* reconfiguration: NumberLen != 0 */303#define SET_SPID1 0x00010000304#define SET_NUMBER1 0x00020000305#define SET_SUBADDRESS1 0x00040000306#define SET_SPID2 0x00100000307#define SET_NUMBER2 0x00200000308#define SET_SUBADDRESS2 0x00400000309#define MASK_SET 0xffff0000310unsigned long Flag ; /* |31-Type-16|15-Channel-0| */311unsigned char *pBuffer ; /* number value */312} isdnNo ;313}314parms315;316} isdnProps ;317/*318* IDI_SYNC_REQ_PORTDRV_HOOK - signal plug/unplug (Award Cardware only)319*/320typedef void ( * PORTDRV_HOOK_CB) (void *Context, int Plug) ;321typedef struct322{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */323unsigned char Req; /* request (must be always 0) */324unsigned char Rc; /* return code (is the request) */325unsigned char Function; /* private function code */326unsigned char Flags; /* function refinements */327PORTDRV_HOOK_CB Callback; /* to be called on plug/unplug */328void *Context; /* context for callback */329unsigned long Info; /* more info if needed */330} PORTDRV_HOOK ;331/* Codes for the 'Rc' element in structure below. */332#define SLI_INSTALL (0xA1)333#define SLI_UNINSTALL (0xA2)334typedef int ( * SLIENTRYPOINT)(void* p3SignalAPI, void* pContext);335typedef struct336{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */337unsigned char Req; /* request (must be always 0) */338unsigned char Rc; /* return code (is the request) */339unsigned char Function; /* private function code */340unsigned char Flags; /* function refinements */341SLIENTRYPOINT Callback; /* to be called on plug/unplug */342void *Context; /* context for callback */343unsigned long Info; /* more info if needed */344} SLIENTRYPOINT_REQ ;345/******************************************************************************/346/*347* Definitions for DIVA USB348*/349typedef int ( * USB_SEND_REQ) (unsigned char PipeIndex, unsigned char Type,void *Data, int sizeData);350typedef int ( * USB_START_DEV) (void *Adapter, void *Ipac) ;351/* called from WDM */352typedef void ( * USB_RECV_NOTIFY) (void *Ipac, void *msg) ;353typedef void ( * USB_XMIT_NOTIFY) (void *Ipac, unsigned char PipeIndex) ;354/******************************************************************************/355/*356* Parameter description for synchronous requests.357*358* Sorry, must repeat some parts of di_defs.h here because359* they are not defined for all operating environments360*/361typedef union362{ ENTITY Entity;363struct364{ /* 'Req' and 'Rc' are at the same place as in the ENTITY struct */365unsigned char Req; /* request (must be always 0) */366unsigned char Rc; /* return code (is the request) */367} Request;368struct369{ unsigned char Req; /* request (must be always 0) */370unsigned char Rc; /* return code (0x01) */371unsigned char name[BOARD_NAME_LENGTH];372} GetName;373struct374{ unsigned char Req; /* request (must be always 0) */375unsigned char Rc; /* return code (0x02) */376unsigned long serial; /* serial number */377} GetSerial;378struct379{ unsigned char Req; /* request (must be always 0) */380unsigned char Rc; /* return code (0x02) */381unsigned long lineIdx;/* line, 0 if card has only one */382} GetLineIdx;383struct384{ unsigned char Req; /* request (must be always 0) */385unsigned char Rc; /* return code (0x02) */386unsigned long cardtype;/* card type */387} GetCardType;388struct389{ unsigned short command;/* command = 0x0300 */390unsigned short dummy; /* not used */391IDI_CALL callback;/* routine to call back */392ENTITY *contxt; /* ptr to entity to use */393} PostCall;394struct395{ unsigned char Req; /* request (must be always 0) */396unsigned char Rc; /* return code (0x04) */397unsigned char pcm[1]; /* buffer (a pc_maint struct) */398} GetXlog;399struct400{ unsigned char Req; /* request (must be always 0) */401unsigned char Rc; /* return code (0x05) */402unsigned short features;/* feature defines see below */403} GetFeatures;404SERIAL_HOOK SerialHook;405/* Added for DIVA USB */406struct407{ unsigned char Req;408unsigned char Rc;409USB_SEND_REQ UsbSendRequest; /* function in Diva Usb WDM driver in usb_os.c, */410/* called from usb_drv.c to send a message to our device */411/* eg UsbSendRequest (USB_PIPE_SIGNAL, USB_IPAC_START, 0, 0) ; */412USB_RECV_NOTIFY usb_recv; /* called from usb_os.c to pass a received message and ptr to IPAC */413/* on to usb_drv.c by a call to usb_recv(). */414USB_XMIT_NOTIFY usb_xmit; /* called from usb_os.c in DivaUSB.sys WDM to indicate a completed transmit */415/* to usb_drv.c by a call to usb_xmit(). */416USB_START_DEV UsbStartDevice; /* Start the USB Device, in usb_os.c */417IDI_CALL callback; /* routine to call back */418ENTITY *contxt; /* ptr to entity to use */419void ** ipac_ptr; /* pointer to struct IPAC in VxD */420} Usb_Msg_old;421/* message used by WDM and VXD to pass pointers of function and IPAC* */422struct423{ unsigned char Req;424unsigned char Rc;425USB_SEND_REQ pUsbSendRequest;/* function in Diva Usb WDM driver in usb_os.c, */426/* called from usb_drv.c to send a message to our device */427/* eg UsbSendRequest (USB_PIPE_SIGNAL, USB_IPAC_START, 0, 0) ; */428USB_RECV_NOTIFY p_usb_recv; /* called from usb_os.c to pass a received message and ptr to IPAC */429/* on to usb_drv.c by a call to usb_recv(). */430USB_XMIT_NOTIFY p_usb_xmit; /* called from usb_os.c in DivaUSB.sys WDM to indicate a completed transmit */431/* to usb_drv.c by a call to usb_xmit().*/432void *ipac_ptr; /* &Diva.ipac pointer to struct IPAC in VxD */433} Usb_Msg;434PORTDRV_HOOK PortdrvHook;435SLIENTRYPOINT_REQ sliEntryPointReq;436struct {437unsigned char Req;438unsigned char Rc;439diva_xdi_stream_interface_t info;440} xdi_stream_info;441struct {442unsigned char Req;443unsigned char Rc;444diva_xdi_get_extended_xdi_features_t info;445} xdi_extended_features;446struct {447unsigned char Req;448unsigned char Rc;449diva_xdi_get_adapter_sdram_bar_t info;450} xdi_sdram_bar;451struct {452unsigned char Req;453unsigned char Rc;454diva_xdi_get_capi_parameters_t info;455} xdi_capi_prms;456struct {457ENTITY e;458diva_didd_adapter_notify_t info;459} didd_notify;460struct {461ENTITY e;462diva_didd_add_adapter_t info;463} didd_add_adapter;464struct {465ENTITY e;466diva_didd_remove_adapter_t info;467} didd_remove_adapter;468struct {469ENTITY e;470diva_didd_read_adapter_array_t info;471} didd_read_adapter_array;472struct {473ENTITY e;474diva_didd_get_cfg_lib_ifc_t info;475} didd_get_cfg_lib_ifc;476struct {477unsigned char Req;478unsigned char Rc;479diva_xdi_get_logical_adapter_number_s_t info;480} xdi_logical_adapter_number;481struct {482unsigned char Req;483unsigned char Rc;484diva_xdi_dma_descriptor_operation_t info;485} xdi_dma_descriptor_operation;486} IDI_SYNC_REQ;487/******************************************************************************/488#endif /* __DIVA_SYNC__H */489490491