Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Functions
platform.h File Reference
#include <linux/module.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/skbuff.h>
#include <linux/vmalloc.h>
#include <linux/proc_fs.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/list.h>
#include <asm/types.h>
#include <asm/io.h>
#include "cardtype.h"
#include <linux/string.h>
#include "debuglib.h"

Go to the source code of this file.

Data Structures

struct  _diva_os_adapter_irq_info
 
struct  _diva_os_soft_isr
 

Macros

#define DIVA_BUILD   "local"
 
#define DIVA_NO_DEBUGLIB
 
#define DIVA_USER_MODE_CARD_CONFIG   1
 
#define USE_EXTENDED_DEBUGS   1
 
#define MAX_ADAPTER   32
 
#define DIVA_ISTREAM   1
 
#define MEMORY_SPACE_TYPE   0
 
#define PORT_SPACE_TYPE   1
 
#define byte   u8
 
#define word   u16
 
#define dword   u32
 
#define qword   u64
 
#define NULL   ((void *) 0)
 
#define far
 
#define _pascal
 
#define _loadds
 
#define _cdecl
 
#define MEM_TYPE_RAM   0
 
#define MEM_TYPE_PORT   1
 
#define MEM_TYPE_PROM   2
 
#define MEM_TYPE_CTLREG   3
 
#define MEM_TYPE_RESET   4
 
#define MEM_TYPE_CFG   5
 
#define MEM_TYPE_ADDRESS   6
 
#define MEM_TYPE_CONFIG   7
 
#define MEM_TYPE_CONTROL   8
 
#define MAX_MEM_TYPE   10
 
#define DIVA_OS_MEM_ATTACH_RAM(a)   ((a)->ram)
 
#define DIVA_OS_MEM_ATTACH_PORT(a)   ((a)->port)
 
#define DIVA_OS_MEM_ATTACH_PROM(a)   ((a)->prom)
 
#define DIVA_OS_MEM_ATTACH_CTLREG(a)   ((a)->ctlReg)
 
#define DIVA_OS_MEM_ATTACH_RESET(a)   ((a)->reset)
 
#define DIVA_OS_MEM_ATTACH_CFG(a)   ((a)->cfg)
 
#define DIVA_OS_MEM_ATTACH_ADDRESS(a)   ((a)->Address)
 
#define DIVA_OS_MEM_ATTACH_CONFIG(a)   ((a)->Config)
 
#define DIVA_OS_MEM_ATTACH_CONTROL(a)   ((a)->Control)
 
#define DIVA_OS_MEM_DETACH_RAM(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_PORT(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_PROM(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_CTLREG(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_RESET(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_CFG(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_ADDRESS(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_CONFIG(a, x)   do { } while (0)
 
#define DIVA_OS_MEM_DETACH_CONTROL(a, x)   do { } while (0)
 
#define DIVA_INVALID_FILE_HANDLE   ((dword)(-1))
 
#define DIVAS_CONTAINING_RECORD(address, type, field)   ((type *)((char *)(address) - (char *)(&((type *)0)->field)))
 
#define dtrc(p)   DBG_PRV0(p)
 
#define dbug(a, p)   DBG_PRV1(p)
 
#define DIVA_MESSAGE_BUFFER_LEN(x)   x->len
 
#define DIVA_MESSAGE_BUFFER_DATA(x)   x->data
 
#define diva_os_in_irq()   in_irq()
 
#define diva_os_destroy_spin_lock(a, b)   do { } while (0)
 
#define NO_CORNETN
 
#define IMPLEMENT_DTMF   1
 
#define IMPLEMENT_ECHO_CANCELLER   1
 
#define IMPLEMENT_RTP   1
 
#define IMPLEMENT_T38   1
 
#define IMPLEMENT_FAX_SUB_SEP_PWD   1
 
#define IMPLEMENT_V18   1
 
#define IMPLEMENT_DTMF_TONE   1
 
#define IMPLEMENT_PIAFS   1
 
#define IMPLEMENT_FAX_PAPER_FORMATS   1
 
#define IMPLEMENT_VOWN   1
 
#define IMPLEMENT_CAPIDTMF   1
 
#define IMPLEMENT_FAX_NONSTANDARD   1
 
#define VSWITCH_SUPPORT   1
 
#define IMPLEMENT_MARKED_OK_AFTER_FC   1
 
#define DIVA_IDI_RX_DMA   1
 
#define READ_BYTE(addr)   readb(addr)
 
#define READ_WORD(addr)   readw(addr)
 
#define READ_DWORD(addr)   readl(addr)
 
#define WRITE_BYTE(addr, v)   writeb(v, addr)
 
#define WRITE_WORD(addr, v)   writew(v, addr)
 
#define WRITE_DWORD(addr, v)   writel(v, addr)
 
#define diva_os_dump_file_t   char
 
#define diva_os_board_trace_t   char
 
#define diva_os_dump_file(__x__)   do { } while (0)
 
#define MAX_DESCRIPTORS   64
 

Typedefs

typedef voidLIST_ENTRY
 
typedef char DEVICE_NAME [64]
 
typedef struct _ISDN_ADAPTER ISDN_ADAPTER
 
typedef struct _ISDN_ADAPTERPISDN_ADAPTER
 
typedef void(* DIVA_DI_PRINTF )(unsigned char *,...)
 
typedef struct e_info_s E_INFO
 
typedef char diva_os_dependent_devica_name_t [64]
 
typedef voidPDEVICE_OBJECT
 
typedef struct sk_buff diva_os_message_buffer_s
 
typedef struct
_diva_os_adapter_irq_info 
diva_os_adapter_irq_info_t
 
typedef long diva_os_spin_lock_magic_t
 
typedef spinlock_t diva_os_spin_lock_t
 
typedef int(* diva_os_isr_callback_t )(struct _ISDN_ADAPTER *)
 
typedef void(* diva_os_soft_isr_callback_t )(struct _diva_os_soft_isr *psoft_isr, void *context)
 
typedef struct _diva_os_soft_isr diva_os_soft_isr_t
 
typedef int diva_os_atomic_t
 

Functions

int sprintf (char *, const char *,...)
 
void diva_log_info (unsigned char *,...)
 
void diva_xdi_didd_register_adapter (int card)
 
void diva_xdi_didd_remove_adapter (int card)
 
diva_os_message_buffer_sdiva_os_alloc_message_buffer (unsigned long size, void **data_buf)
 
void diva_os_free_message_buffer (diva_os_message_buffer_s *dmb)
 
void PCIwrite (byte bus, byte func, int offset, void *data, int length, void *pci_dev_handle)
 
void PCIread (byte bus, byte func, int offset, void *data, int length, void *pci_dev_handle)
 
int diva_os_register_io_port (void *adapter, int register, unsigned long port, unsigned long length, const char *name, int id)
 
byte inpp (void __iomem *)
 
word inppw (void __iomem *)
 
void inppw_buffer (void __iomem *, void *, int)
 
void outppw (void __iomem *, word)
 
void outppw_buffer (void __iomem *, void *, int)
 
void outpp (void __iomem *, word)
 
int diva_os_register_irq (void *context, byte irq, const char *name)
 
void diva_os_remove_irq (void *context, byte irq)
 
int diva_os_initialize_soft_isr (diva_os_soft_isr_t *psoft_isr, diva_os_soft_isr_callback_t callback, void *callback_context)
 
int diva_os_schedule_soft_isr (diva_os_soft_isr_t *psoft_isr)
 
int diva_os_cancel_soft_isr (diva_os_soft_isr_t *psoft_isr)
 
void diva_os_remove_soft_isr (diva_os_soft_isr_t *psoft_isr)
 
void diva_os_get_time (dword *sec, dword *usec)
 

Macro Definition Documentation

#define _cdecl

Definition at line 87 of file platform.h.

#define _loadds

Definition at line 83 of file platform.h.

#define _pascal

Definition at line 79 of file platform.h.

#define byte   u8

Definition at line 55 of file platform.h.

#define dbug (   a,
  p 
)    DBG_PRV1(p)

Definition at line 139 of file platform.h.

#define DIVA_BUILD   "local"

Definition at line 18 of file platform.h.

#define DIVA_IDI_RX_DMA   1

Definition at line 307 of file platform.h.

#define DIVA_INVALID_FILE_HANDLE   ((dword)(-1))

Definition at line 122 of file platform.h.

#define DIVA_ISTREAM   1

Definition at line 46 of file platform.h.

#define DIVA_MESSAGE_BUFFER_DATA (   x)    x->data

Definition at line 183 of file platform.h.

#define DIVA_MESSAGE_BUFFER_LEN (   x)    x->len

Definition at line 182 of file platform.h.

#define DIVA_NO_DEBUGLIB

Definition at line 38 of file platform.h.

#define diva_os_board_trace_t   char

Definition at line 361 of file platform.h.

#define diva_os_destroy_spin_lock (   a,
  b 
)    do { } while (0)

Definition at line 245 of file platform.h.

#define diva_os_dump_file (   __x__)    do { } while (0)

Definition at line 362 of file platform.h.

#define diva_os_dump_file_t   char

Definition at line 360 of file platform.h.

#define diva_os_in_irq ( )    in_irq()

Definition at line 229 of file platform.h.

#define DIVA_OS_MEM_ATTACH_ADDRESS (   a)    ((a)->Address)

Definition at line 108 of file platform.h.

#define DIVA_OS_MEM_ATTACH_CFG (   a)    ((a)->cfg)

Definition at line 107 of file platform.h.

#define DIVA_OS_MEM_ATTACH_CONFIG (   a)    ((a)->Config)

Definition at line 109 of file platform.h.

#define DIVA_OS_MEM_ATTACH_CONTROL (   a)    ((a)->Control)

Definition at line 110 of file platform.h.

#define DIVA_OS_MEM_ATTACH_CTLREG (   a)    ((a)->ctlReg)

Definition at line 105 of file platform.h.

#define DIVA_OS_MEM_ATTACH_PORT (   a)    ((a)->port)

Definition at line 103 of file platform.h.

#define DIVA_OS_MEM_ATTACH_PROM (   a)    ((a)->prom)

Definition at line 104 of file platform.h.

#define DIVA_OS_MEM_ATTACH_RAM (   a)    ((a)->ram)

Definition at line 102 of file platform.h.

#define DIVA_OS_MEM_ATTACH_RESET (   a)    ((a)->reset)

Definition at line 106 of file platform.h.

#define DIVA_OS_MEM_DETACH_ADDRESS (   a,
  x 
)    do { } while (0)

Definition at line 118 of file platform.h.

#define DIVA_OS_MEM_DETACH_CFG (   a,
  x 
)    do { } while (0)

Definition at line 117 of file platform.h.

#define DIVA_OS_MEM_DETACH_CONFIG (   a,
  x 
)    do { } while (0)

Definition at line 119 of file platform.h.

#define DIVA_OS_MEM_DETACH_CONTROL (   a,
  x 
)    do { } while (0)

Definition at line 120 of file platform.h.

#define DIVA_OS_MEM_DETACH_CTLREG (   a,
  x 
)    do { } while (0)

Definition at line 115 of file platform.h.

#define DIVA_OS_MEM_DETACH_PORT (   a,
  x 
)    do { } while (0)

Definition at line 113 of file platform.h.

#define DIVA_OS_MEM_DETACH_PROM (   a,
  x 
)    do { } while (0)

Definition at line 114 of file platform.h.

#define DIVA_OS_MEM_DETACH_RAM (   a,
  x 
)    do { } while (0)

Definition at line 112 of file platform.h.

#define DIVA_OS_MEM_DETACH_RESET (   a,
  x 
)    do { } while (0)

Definition at line 116 of file platform.h.

#define DIVA_USER_MODE_CARD_CONFIG   1

Definition at line 41 of file platform.h.

#define DIVAS_CONTAINING_RECORD (   address,
  type,
  field 
)    ((type *)((char *)(address) - (char *)(&((type *)0)->field)))

Definition at line 124 of file platform.h.

#define dtrc (   p)    DBG_PRV0(p)

Definition at line 138 of file platform.h.

#define dword   u32

Definition at line 63 of file platform.h.

#define far

Definition at line 75 of file platform.h.

#define IMPLEMENT_CAPIDTMF   1

Definition at line 301 of file platform.h.

#define IMPLEMENT_DTMF   1

Definition at line 291 of file platform.h.

#define IMPLEMENT_DTMF_TONE   1

Definition at line 297 of file platform.h.

#define IMPLEMENT_ECHO_CANCELLER   1

Definition at line 292 of file platform.h.

#define IMPLEMENT_FAX_NONSTANDARD   1

Definition at line 302 of file platform.h.

#define IMPLEMENT_FAX_PAPER_FORMATS   1

Definition at line 299 of file platform.h.

#define IMPLEMENT_FAX_SUB_SEP_PWD   1

Definition at line 295 of file platform.h.

#define IMPLEMENT_MARKED_OK_AFTER_FC   1

Definition at line 305 of file platform.h.

#define IMPLEMENT_PIAFS   1

Definition at line 298 of file platform.h.

#define IMPLEMENT_RTP   1

Definition at line 293 of file platform.h.

#define IMPLEMENT_T38   1

Definition at line 294 of file platform.h.

#define IMPLEMENT_V18   1

Definition at line 296 of file platform.h.

#define IMPLEMENT_VOWN   1

Definition at line 300 of file platform.h.

#define MAX_ADAPTER   32

Definition at line 44 of file platform.h.

#define MAX_DESCRIPTORS   64

Definition at line 367 of file platform.h.

#define MAX_MEM_TYPE   10

Definition at line 100 of file platform.h.

#define MEM_TYPE_ADDRESS   6

Definition at line 96 of file platform.h.

#define MEM_TYPE_CFG   5

Definition at line 95 of file platform.h.

#define MEM_TYPE_CONFIG   7

Definition at line 97 of file platform.h.

#define MEM_TYPE_CONTROL   8

Definition at line 98 of file platform.h.

#define MEM_TYPE_CTLREG   3

Definition at line 93 of file platform.h.

#define MEM_TYPE_PORT   1

Definition at line 91 of file platform.h.

#define MEM_TYPE_PROM   2

Definition at line 92 of file platform.h.

#define MEM_TYPE_RAM   0

Definition at line 90 of file platform.h.

#define MEM_TYPE_RESET   4

Definition at line 94 of file platform.h.

#define MEMORY_SPACE_TYPE   0

Definition at line 48 of file platform.h.

#define NO_CORNETN

Definition at line 290 of file platform.h.

#define NULL   ((void *) 0)

Definition at line 71 of file platform.h.

#define PORT_SPACE_TYPE   1

Definition at line 49 of file platform.h.

#define qword   u64

Definition at line 67 of file platform.h.

#define READ_BYTE (   addr)    readb(addr)

Definition at line 315 of file platform.h.

#define READ_DWORD (   addr)    readl(addr)

Definition at line 317 of file platform.h.

#define READ_WORD (   addr)    readw(addr)

Definition at line 316 of file platform.h.

#define USE_EXTENDED_DEBUGS   1

Definition at line 42 of file platform.h.

#define VSWITCH_SUPPORT   1

Definition at line 303 of file platform.h.

u32 word   u16

Definition at line 59 of file platform.h.

#define WRITE_BYTE (   addr,
  v 
)    writeb(v, addr)

Definition at line 319 of file platform.h.

#define WRITE_DWORD (   addr,
  v 
)    writel(v, addr)

Definition at line 321 of file platform.h.

#define WRITE_WORD (   addr,
  v 
)    writew(v, addr)

Definition at line 320 of file platform.h.

Typedef Documentation

typedef char DEVICE_NAME[64]

Definition at line 131 of file platform.h.

typedef void(* DIVA_DI_PRINTF)(unsigned char *,...)

Definition at line 135 of file platform.h.

Definition at line 273 of file platform.h.

typedef char diva_os_dependent_devica_name_t[64]

Definition at line 144 of file platform.h.

typedef int(* diva_os_isr_callback_t)(struct _ISDN_ADAPTER *)

Definition at line 250 of file platform.h.

Definition at line 179 of file platform.h.

typedef void(* diva_os_soft_isr_callback_t)(struct _diva_os_soft_isr *psoft_isr, void *context)

Definition at line 251 of file platform.h.

Definition at line 234 of file platform.h.

Definition at line 235 of file platform.h.

Definition at line 142 of file platform.h.

Definition at line 132 of file platform.h.

typedef void* LIST_ENTRY

Definition at line 129 of file platform.h.

typedef void* PDEVICE_OBJECT

Definition at line 145 of file platform.h.

Definition at line 133 of file platform.h.

Function Documentation

void diva_log_info ( unsigned char ,
  ... 
)

Definition at line 178 of file divasmain.c.

diva_os_message_buffer_s* diva_os_alloc_message_buffer ( unsigned long  size,
void **  data_buf 
)

Definition at line 59 of file capimain.c.

int diva_os_cancel_soft_isr ( diva_os_soft_isr_t psoft_isr)

Definition at line 535 of file divasmain.c.

void diva_os_free_message_buffer ( diva_os_message_buffer_s dmb)

Definition at line 72 of file capimain.c.

void diva_os_get_time ( dword sec,
dword usec 
)

Definition at line 89 of file divamnt.c.

int diva_os_initialize_soft_isr ( diva_os_soft_isr_t psoft_isr,
diva_os_soft_isr_callback_t  callback,
void callback_context 
)

Definition at line 504 of file divasmain.c.

int diva_os_register_io_port ( void adapter,
int  register,
unsigned long  port,
unsigned long  length,
const char name,
int  id 
)

Definition at line 417 of file divasmain.c.

int diva_os_register_irq ( void context,
byte  irq,
const char name 
)

Definition at line 481 of file divasmain.c.

void diva_os_remove_irq ( void context,
byte  irq 
)

Definition at line 488 of file divasmain.c.

void diva_os_remove_soft_isr ( diva_os_soft_isr_t psoft_isr)

Definition at line 540 of file divasmain.c.

int diva_os_schedule_soft_isr ( diva_os_soft_isr_t psoft_isr)

Definition at line 523 of file divasmain.c.

void diva_xdi_didd_register_adapter ( int  card)

Definition at line 64 of file divasfunc.c.

void diva_xdi_didd_remove_adapter ( int  card)

Definition at line 95 of file divasfunc.c.

byte inpp ( void __iomem )

Definition at line 448 of file divasmain.c.

word inppw ( void __iomem )

Definition at line 453 of file divasmain.c.

void inppw_buffer ( void __iomem ,
void ,
int   
)

Definition at line 458 of file divasmain.c.

void outpp ( void __iomem ,
word   
)

Definition at line 473 of file divasmain.c.

void outppw ( void __iomem ,
word   
)

Definition at line 468 of file divasmain.c.

void outppw_buffer ( void __iomem ,
void ,
int   
)

Definition at line 463 of file divasmain.c.

void PCIread ( byte  bus,
byte  func,
int  offset,
void data,
int  length,
void pci_dev_handle 
)

Definition at line 293 of file divasmain.c.

void PCIwrite ( byte  bus,
byte  func,
int  offset,
void data,
int  length,
void pci_dev_handle 
)

Definition at line 252 of file divasmain.c.

int sprintf ( char buf,
const char fmt,
  ... 
)

sprintf - Format a string and place it in a buffer : The buffer to place the result into : The format string to use ..: Arguments for the format string

The function returns the number of characters written into . Use snprintf() or scnprintf() in order to avoid buffer overflows.

See the vsnprintf() documentation for format string extensions over C99.

Definition at line 309 of file stdio.c.