📄 divasync.h
字号:
/* * Copyright (c) Eicon Networks, 2002. * This source file is supplied for the use with Eicon Networks range of DIVA Server Adapters. * Eicon File Revision : 2.1 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */#ifndef __DIVA_SYNC__H #define __DIVA_SYNC__H#define IDI_SYNC_REQ_REMOVE 0x00#define IDI_SYNC_REQ_GET_NAME 0x01#define IDI_SYNC_REQ_GET_SERIAL 0x02#define IDI_SYNC_REQ_SET_POSTCALL 0x03#define IDI_SYNC_REQ_GET_XLOG 0x04#define IDI_SYNC_REQ_GET_FEATURES 0x05#define IDI_SYNC_REQ_USB_REGISTER 0x06#define IDI_SYNC_REQ_USB_RELEASE 0x07#define IDI_SYNC_REQ_USB_ADD_DEVICE 0x08#define IDI_SYNC_REQ_USB_START_DEVICE 0x09#define IDI_SYNC_REQ_USB_STOP_DEVICE 0x0A#define IDI_SYNC_REQ_USB_REMOVE_DEVICE 0x0B#define IDI_SYNC_REQ_GET_CARDTYPE 0x0C#define IDI_SYNC_REQ_GET_DBG_XLOG 0x0D#define DIVA_USB#define DIVA_USB_REQ 0xAC#define DIVA_USB_TEST 0xAB#define DIVA_USB_ADD_ADAPTER 0xAC#define DIVA_USB_REMOVE_ADAPTER 0xAD#define IDI_SYNC_REQ_SERIAL_HOOK 0x80#define IDI_SYNC_REQ_XCHANGE_STATUS 0x81#define IDI_SYNC_REQ_USB_HOOK 0x82#define IDI_SYNC_REQ_PORTDRV_HOOK 0x83#define IDI_SYNC_REQ_SLI 0x84 /* SLI request from 3signal modem drivers */#define IDI_SYNC_REQ_RECONFIGURE 0x85#define IDI_SYNC_REQ_RESET 0x86#define IDI_SYNC_REQ_GET_85X_DEVICE_DATA 0x87#define IDI_SYNC_REQ_LOCK_85X 0x88#define IDI_SYNC_REQ_DIVA_85X_USB_DATA_EXCHANGE 0x99#define IDI_SYNC_REQ_DIPORT_EXCHANGE_REQ 0x98#define IDI_SYNC_REQ_GET_85X_EXT_PORT_TYPE 0xA0/******************************************************************************/#define IDI_SYNC_REQ_XDI_GET_EXTENDED_FEATURES 0x92/* To receive XDI features: 1. set 'buffer_length_in_bytes' to length of you buffer 2. set 'features' to pointer to your buffer 3. issue synchronous request to XDI 4. Check that feature 'DIVA_XDI_EXTENDED_FEATURES_VALID' is present after call. This feature does indicate that your request was processed and XDI does support this synchronous request 5. if on return bit 31 (0x80000000) in 'buffer_length_in_bytes' is set then provided buffer was too small, and bits 30-0 does contain necessary length of buffer. in this case only features that do find place in the buffer are indicated to caller*/typedef struct _diva_xdi_get_extended_xdi_features { dword buffer_length_in_bytes; byte *features;} diva_xdi_get_extended_xdi_features_t;/* features[0] */#define DIVA_XDI_EXTENDED_FEATURES_VALID 0x01#define DIVA_XDI_EXTENDED_FEATURE_CMA 0x02#define DIVA_XDI_EXTENDED_FEATURE_SDRAM_BAR 0x04#define DIVA_XDI_EXTENDED_FEATURE_CAPI_PRMS 0x08#define DIVA_XDI_EXTENDED_FEATURE_NO_CANCEL_RC 0x10#define DIVA_XDI_EXTENDED_FEATURE_RX_DMA 0x20#define DIVA_XDI_EXTENDED_FEATURE_MANAGEMENT_DMA 0x40#define DIVA_XDI_EXTENDED_FEATURE_WIDE_ID 0x80#define DIVA_XDI_EXTENDED_FEATURES_MAX_SZ 1/******************************************************************************/#define IDI_SYNC_REQ_XDI_GET_ADAPTER_SDRAM_BAR 0x93typedef struct _diva_xdi_get_adapter_sdram_bar { dword bar;} diva_xdi_get_adapter_sdram_bar_t;/******************************************************************************/#define IDI_SYNC_REQ_XDI_GET_CAPI_PARAMS 0x94/* CAPI Parameters will be written in the caller's buffer */typedef struct _diva_xdi_get_capi_parameters { dword structure_length; byte flag_dynamic_l1_down; byte group_optimization_enabled;} diva_xdi_get_capi_parameters_t;/******************************************************************************/#define IDI_SYNC_REQ_XDI_GET_LOGICAL_ADAPTER_NUMBER 0x95/* Get logical adapter number, as assigned by XDI 'controller' is starting with zero 'sub' controller number in case of one adapter that supports multiple interfaces 'controller' is zero for Master adapter (and adapter that supports only one interface) */typedef struct _diva_xdi_get_logical_adapter_number { dword logical_adapter_number; dword controller; dword total_controllers;} diva_xdi_get_logical_adapter_number_s_t;/******************************************************************************/#define IDI_SYNC_REQ_UP1DM_OPERATION 0x96/******************************************************************************/#define IDI_SYNC_REQ_DMA_DESCRIPTOR_OPERATION 0x97#define IDI_SYNC_REQ_DMA_DESCRIPTOR_ALLOC 0x01#define IDI_SYNC_REQ_DMA_DESCRIPTOR_FREE 0x02typedef struct _diva_xdi_dma_descriptor_operation { int operation; int descriptor_number; void* descriptor_address; dword descriptor_magic;} diva_xdi_dma_descriptor_operation_t;/******************************************************************************/#define IDI_SYNC_REQ_DIDD_REGISTER_ADAPTER_NOTIFY 0x01#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER_NOTIFY 0x02#define IDI_SYNC_REQ_DIDD_ADD_ADAPTER 0x03#define IDI_SYNC_REQ_DIDD_REMOVE_ADAPTER 0x04#define IDI_SYNC_REQ_DIDD_READ_ADAPTER_ARRAY 0x05#define IDI_SYNC_REQ_DIDD_GET_CFG_LIB_IFC 0x10typedef struct _diva_didd_adapter_notify { dword handle; /* Notification handle */ void * callback; void * context;} diva_didd_adapter_notify_t;typedef struct _diva_didd_add_adapter { void * descriptor;} diva_didd_add_adapter_t;typedef struct _diva_didd_remove_adapter { IDI_CALL p_request;} diva_didd_remove_adapter_t;typedef struct _diva_didd_read_adapter_array { void * buffer; dword length;} diva_didd_read_adapter_array_t;typedef struct _diva_didd_get_cfg_lib_ifc { void* ifc;} diva_didd_get_cfg_lib_ifc_t;/******************************************************************************/#define IDI_SYNC_REQ_XDI_GET_STREAM 0x91#define DIVA_XDI_SYNCHRONOUS_SERVICE 0x01#define DIVA_XDI_DMA_SERVICE 0x02#define DIVA_XDI_AUTO_SERVICE 0x03#define DIVA_ISTREAM_COMPLETE_NOTIFY 0#define DIVA_ISTREAM_COMPLETE_READ 1#define DIVA_ISTREAM_COMPLETE_WRITE 2typedef struct _diva_xdi_stream_interface { unsigned char Id; /* filled by XDI client */ unsigned char provided_service; /* filled by XDI */ unsigned char requested_service; /* filled by XDI Client */ void* xdi_context; /* filled by XDI */ void* client_context; /* filled by XDI client */ int (*write)(void* context, int Id, void* data, int length, int final, byte usr1, byte usr2); int (*read)(void* context, int Id, void* data, int max_length, int* final, byte* usr1, byte* usr2); int (*complete)(void* client_context, int Id, int what, void* data, int length, int* final);} diva_xdi_stream_interface_t;/******************************************************************************//* * IDI_SYNC_REQ_SERIAL_HOOK - special interface for the DIVA Mobile card */typedef struct{ unsigned char LineState; /* Modem line state (STATUS_R) */#define SERIAL_GSM_CELL 0x01 /* GSM or CELL cable attached */ unsigned char CardState; /* PCMCIA card state (0 = down) */ unsigned char IsdnState; /* ISDN layer 1 state (0 = down)*/ unsigned char HookState; /* current logical hook state */#define SERIAL_ON_HOOK 0x02 /* set in DIVA CTRL_R register */} SERIAL_STATE;typedef int ( * SERIAL_INT_CB) (void *Context) ;typedef int ( * SERIAL_DPC_CB) (void *Context) ;typedef unsigned char ( * SERIAL_I_SYNC) (void *Context) ;typedef struct{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */ unsigned char Req; /* request (must be always 0) */ unsigned char Rc; /* return code (is the request) */ unsigned char Function; /* private function code */#define SERIAL_HOOK_ATTACH 0x81#define SERIAL_HOOK_STATUS 0x82#define SERIAL_HOOK_I_SYNC 0x83#define SERIAL_HOOK_NOECHO 0x84#define SERIAL_HOOK_RING 0x85#define SERIAL_HOOK_DETACH 0x8f unsigned char Flags; /* function refinements */ /* parameters passed by the the ATTACH request */ SERIAL_INT_CB InterruptHandler; /* called on each interrupt */ SERIAL_DPC_CB DeferredHandler; /* called on hook state changes */ void *HandlerContext; /* context for both handlers */ /* return values for both the ATTACH and the STATUS request */ unsigned long IoBase; /* IO port assigned to UART */ SERIAL_STATE State; /* parameters and return values for the I_SYNC function */ SERIAL_I_SYNC SyncFunction; /* to be called synchronized */ void *SyncContext; /* context for this function */ unsigned char SyncResult; /* return value of function */} SERIAL_HOOK;/* * IDI_SYNC_REQ_XCHANGE_STATUS - exchange the status between IDI and WMP * IDI_SYNC_REQ_RECONFIGURE - reconfiguration of IDI from WMP */typedef struct{ /* 'Req' and 'Rc' must be at the same place as in the ENTITY struct */ unsigned char Req; /* request (must be always 0) */ unsigned char Rc; /* return code (is the request) */#define DRIVER_STATUS_BOOT 0xA1#define DRIVER_STATUS_INIT_DEV 0xA2#define DRIVER_STATUS_RUNNING 0xA3#define DRIVER_STATUS_SHUTDOWN 0xAF#define DRIVER_STATUS_TRAPPED 0xAE unsigned char wmpStatus; /* exported by WMP */ unsigned char idiStatus; /* exported by IDI */ unsigned long wizProto ; /* from WMP registry to IDI */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -