1
2
3
4
5
6
7
8
9
10
11#include <linux/sched.h>
12#undef N_DATA
13#include <linux/tqueue.h>
14
15#include <linux/smp.h>
16struct pt_regs;
17#include <linux/interrupt.h>
18#include <linux/ioport.h>
19
20#include "sys.h"
21#include "divas.h"
22#include "adapter.h"
23#include "divalog.h"
24
25#include "uxio.h"
26
27int Divas4BRIInitPCI(card_t *card, dia_card_t *cfg)
28{
29
30
31
32
33
34
35
36
37
38
39
40 return 0;
41}
42
43int DivasPRIInitPCI(card_t *card, dia_card_t *cfg)
44{
45
46
47
48
49
50
51
52
53
54
55
56 return 0;
57}
58
59int DivasBRIInitPCI(card_t *card, dia_card_t *cfg)
60{
61
62
63 card->hw->reset_base = card->cfg.reset_base;
64 card->hw->io_base = card->cfg.io_base;
65
66 request_region(card->hw->reset_base,0x80,"Divas");
67 request_region(card->hw->io_base,0x20,"Divas");
68
69
70
71 return DivasPRIInitPCI(card, cfg);
72}
73
74
75
76
77
78
79
80int DivasDpcSchedule(void)
81{
82 static struct tq_struct DivasTask;
83
84 DivasTask.routine = DivasDoDpc;
85 DivasTask.data = (void *) 0;
86
87 queue_task(&DivasTask, &tq_immediate);
88 mark_bh(IMMEDIATE_BH);
89
90 return 0;
91}
92
93int DivasScheduleRequestDpc(void)
94{
95 static struct tq_struct DivasTask;
96
97 DivasTask.routine = DivasDoRequestDpc;
98 DivasTask.data = (void *) 0;
99
100 queue_task(&DivasTask, &tq_immediate);
101 mark_bh(IMMEDIATE_BH);
102
103 return 0;
104}
105
106void DivasLogAdd(void *buffer, int length)
107{
108 static
109 boolean_t overflow = FALSE;
110 static
111 boolean_t busy = FALSE;
112
113
114
115 if (busy)
116 {
117 printk(KERN_DEBUG "Divas: Logging interrupting self !\n");
118 return;
119 }
120 busy = TRUE;
121
122
123
124 if (DivasLogFifoFull())
125 {
126 if (!overflow)
127 {
128 printk(KERN_DEBUG "Divas: Trace buffer full\n");
129 overflow = TRUE;
130 }
131 busy = FALSE;
132 return;
133 }
134
135 DivasLogFifoWrite(buffer, length);
136
137 busy = FALSE;
138 return;
139}
140
141
142