Path: blob/master/drivers/isdn/hardware/eicon/di.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/*26* some macros for detailed trace management27*/28#include "di_dbg.h"29/*****************************************************************************/30#define XMOREC 0x1f31#define XMOREF 0x2032#define XBUSY 0x4033#define RMORE 0x8034#define DIVA_MISC_FLAGS_REMOVE_PENDING 0x0135#define DIVA_MISC_FLAGS_NO_RC_CANCELLING 0x0236#define DIVA_MISC_FLAGS_RX_DMA 0x0437/* structure for all information we have to keep on a per */38/* adapater basis */39typedef struct adapter_s ADAPTER;40struct adapter_s {41void * io;42byte IdTable[256];43byte IdTypeTable[256];44byte FlowControlIdTable[256];45byte FlowControlSkipTable[256];46byte ReadyInt;47byte RcExtensionSupported;48byte misc_flags_table[256];49dword protocol_capabilities;50byte ( * ram_in)(ADAPTER * a, void * adr);51word ( * ram_inw)(ADAPTER * a, void * adr);52void (* ram_in_buffer)(ADAPTER * a, void * adr, void * P, word length);53void (* ram_look_ahead)(ADAPTER * a, PBUFFER * RBuffer, ENTITY * e);54void ( * ram_out)(ADAPTER * a, void * adr, byte data);55void ( * ram_outw)(ADAPTER * a, void * adr, word data);56void (* ram_out_buffer)(ADAPTER * a, void * adr, void * P, word length);57void ( * ram_inc)(ADAPTER * a, void * adr);58#if defined(DIVA_ISTREAM)59dword rx_stream[256];60dword tx_stream[256];61word tx_pos[256];62word rx_pos[256];63byte stream_buffer[2512];64dword ( * ram_offset)(ADAPTER * a);65void ( * ram_out_dw) (ADAPTER *a,66void *addr,67const dword* data,68int dwords);69void ( * ram_in_dw) (ADAPTER *a,70void *addr,71dword* data,72int dwords);73void ( * istream_wakeup)(ADAPTER* a);74#else75byte stream_buffer[4];76#endif77};78/*------------------------------------------------------------------*/79/* public functions of IDI common code */80/*------------------------------------------------------------------*/81void pr_out(ADAPTER * a);82byte pr_dpc(ADAPTER * a);83byte scom_test_int(ADAPTER * a);84void scom_clear_int(ADAPTER * a);85/*------------------------------------------------------------------*/86/* OS specific functions used by IDI common code */87/*------------------------------------------------------------------*/88void free_entity(ADAPTER * a, byte e_no);89void assign_queue(ADAPTER * a, byte e_no, word ref);90byte get_assign(ADAPTER * a, word ref);91void req_queue(ADAPTER * a, byte e_no);92byte look_req(ADAPTER * a);93void next_req(ADAPTER * a);94ENTITY * entity_ptr(ADAPTER * a, byte e_no);95#if defined(DIVA_ISTREAM)96struct _diva_xdi_stream_interface;97void diva_xdi_provide_istream_info (ADAPTER* a,98struct _diva_xdi_stream_interface* pI);99void pr_stream (ADAPTER * a);100int diva_istream_write (void* context,101int Id,102void* data,103int length,104int final,105byte usr1,106byte usr2);107int diva_istream_read (void* context,108int Id,109void* data,110int max_length,111int* final,112byte* usr1,113byte* usr2);114#if defined(DIVA_IDI_RX_DMA)115#include "diva_dma.h"116#endif117#endif118119120