1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20#ifndef CARD_H
21#define CARD_H
22
23
24
25
26#include <linux/timer.h>
27#include <linux/time.h>
28#include <linux/isdnif.h>
29#include <linux/irqreturn.h>
30#include "message.h"
31#include "scioc.h"
32
33
34
35
36#define CHECKRESET_TIME msecs_to_jiffies(4000)
37
38
39
40
41#define CHECKSTAT_TIME msecs_to_jiffies(8000)
42
43
44
45
46
47#define SAR_TIMEOUT msecs_to_jiffies(10000)
48
49
50
51
52#define IS_VALID_CARD(x) ((x >= 0) && (x <= cinst))
53
54
55
56
57typedef struct {
58 int l2_proto;
59 int l3_proto;
60 char dn[50];
61 unsigned long first_sendbuf;
62 unsigned int num_sendbufs;
63 unsigned int free_sendbufs;
64 unsigned int next_sendbuf;
65 char eazlist[50];
66 char sillist[50];
67 int eazclear;
68} bchan;
69
70
71
72
73typedef struct {
74 int model;
75 int driverId;
76 char devicename[20];
77 isdn_if *card;
78 bchan *channel;
79 char nChannels;
80 unsigned int interrupt;
81 int iobase;
82 int ioport[MAX_IO_REGS];
83 int shmem_pgport;
84 int shmem_magic;
85 unsigned int rambase;
86 unsigned int ramsize;
87 RspMessage async_msg;
88 int want_async_messages;
89 unsigned char seq_no;
90 struct timer_list reset_timer;
91 struct timer_list stat_timer;
92 unsigned char nphystat;
93 unsigned char phystat;
94 HWConfig_pl hwconfig;
95 char load_ver[11];
96 char proc_ver[11];
97 int StartOnReset;
98 int EngineUp;
99 int trace_mode;
100 spinlock_t lock;
101} board;
102
103
104extern board *sc_adapter[];
105extern int cinst;
106
107void memcpy_toshmem(int card, void *dest, const void *src, size_t n);
108void memcpy_fromshmem(int card, void *dest, const void *src, size_t n);
109int get_card_from_id(int driver);
110int indicate_status(int card, int event, ulong Channel, char *Data);
111irqreturn_t interrupt_handler(int interrupt, void *cardptr);
112int sndpkt(int devId, int channel, int ack, struct sk_buff *data);
113void rcvpkt(int card, RspMessage *rcvmsg);
114int command(isdn_ctrl *cmd);
115int reset(int card);
116int startproc(int card);
117int send_and_receive(int card, unsigned int procid, unsigned char type,
118 unsigned char class, unsigned char code,
119 unsigned char link, unsigned char data_len,
120 unsigned char *data, RspMessage *mesgdata, int timeout);
121void flushreadfifo(int card);
122int sendmessage(int card, unsigned int procid, unsigned int type,
123 unsigned int class, unsigned int code, unsigned int link,
124 unsigned int data_len, unsigned int *data);
125int receivemessage(int card, RspMessage *rspmsg);
126int sc_ioctl(int card, scs_ioctl *data);
127int setup_buffers(int card, int c);
128void sc_check_reset(unsigned long data);
129void check_phystat(unsigned long data);
130
131#endif
132