4
Copyright (C) 2004,2005 ADDI-DATA GmbH for the source code of this module.
10
Fax: +49(0)7223/9493-92
11
http://www.addi-data.com
14
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 of the License, or (at your option) any later version.
16
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
You should also find the complete GPL in the COPYING file accompanying this source code.
26
+-----------------------------------------------------------------------+
27
| (C) ADDI-DATA GmbH DieselstraĆe 3 D-77833 Ottersweier |
28
+-----------------------------------------------------------------------+
29
| Tel : +49 (0) 7223/9493-0 | email : info@addi-data.com |
30
| Fax : +49 (0) 7223/9493-92 | Internet : http://www.addi-data.com |
31
+-----------------------------------------------------------------------+
32
| Project : API APCI1710 | Compiler : gcc |
33
| Module name : TOR.C | Version : 2.96 |
34
+-------------------------------+---------------------------------------+
35
| Project manager: Eric Stolz | Date : 02/12/2002 |
36
+-----------------------------------------------------------------------+
37
| Description : APCI-1710 tor counter module |
40
+-----------------------------------------------------------------------+
42
+-----------------------------------------------------------------------+
43
| Date | Author | Description of updates |
44
+----------+-----------+------------------------------------------------+
45
| 27/01/99 | S. Weber | 40 MHz implementation |
46
+-----------------------------------------------------------------------+
47
| 28/04/00 | S. Weber | Simple,double and quadruple mode implementation|
48
| | | Extern clock implementation |
49
+-----------------------------------------------------------------------+
50
| 08/05/00 | Guinot C | - 0400/0228 All Function in RING 0 |
52
+-----------------------------------------------------------------------+
56
+----------------------------------------------------------------------------+
58
+----------------------------------------------------------------------------+
61
#include "APCI1710_Tor.h"
64
+----------------------------------------------------------------------------+
65
| Function Name : _INT_ i_APCI1710_InitTorCounter |
66
| (unsigned char_ b_BoardHandle, |
67
| unsigned char_ b_ModulNbr, |
68
| unsigned char_ b_TorCounter, |
69
| unsigned char_ b_PCIInputClock, |
70
| unsigned char_ b_TimingUnit, |
71
| ULONG_ ul_TimingInterval, |
72
| PULONG_ pul_RealTimingInterval) |
73
+----------------------------------------------------------------------------+
74
| Task : Configure the selected tor counter (b_TorCounter) |
75
| from selected module (b_ModulNbr). |
76
| The ul_TimingInterval and ul_TimingUnit determine the |
77
| timing base for the measurement. |
78
| The pul_RealTimingInterval return the real timing |
79
| value. You must calling this function be for you call |
80
| any other function witch access of the tor counter. |
82
+----------------------------------------------------------------------------+
83
| Input Parameters : |
85
CR_AREF unsigned char_ b_ModulNbr : Module number to configure |
87
| data[0] unsigned char_ b_TorCounter : Tor counter selection |
89
| data[1] unsigned char_ b_PCIInputClock : Selection from PCI bus clock|
90
| - APCI1710_30MHZ : |
91
| The PC have a PCI bus |
93
| - APCI1710_33MHZ : |
94
| The PC have a PCI bus |
97
| The APCI-1710 have a |
100
| - APCI1710_GATE_INPUT |
101
| Used the gate input for |
102
| the base clock. If you |
103
| have selected this option,|
104
| than it is not possibl to |
105
| used the gate input for |
106
| enabled the acquisition |
107
| data[2] unsigned char_ b_TimingUnit : Base timing unit (0 to 4) |
113
| data[3] ULONG_ ul_TimingInterval : Base timing value. |
114
+----------------------------------------------------------------------------+
115
| Output Parameters : PULONG_ pul_RealTimingInterval : Real base timing |
117
+----------------------------------------------------------------------------+
118
| Return Value : 0: No error |
119
| -1: The handle parameter of the board is wrong |
120
| -2: Module selection wrong |
121
| -3: The module is not a tor counter module |
122
| -4: Tor counter selection is wrong |
123
| -5: The selected PCI input clock is wrong |
124
| -6: Timing unit selection is wrong |
125
| -7: Base timing selection is wrong |
126
| -8: You can not used the 40MHz clock selection wich |
128
| -9: You can not used the 40MHz clock selection wich |
130
+----------------------------------------------------------------------------+
133
int i_APCI1710_InsnConfigInitTorCounter(struct comedi_device *dev,
134
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
136
int i_ReturnValue = 0;
137
unsigned int ul_TimerValue = 0;
138
unsigned int dw_Command;
139
double d_RealTimingInterval = 0;
140
unsigned char b_ModulNbr;
141
unsigned char b_TorCounter;
142
unsigned char b_PCIInputClock;
143
unsigned char b_TimingUnit;
144
unsigned int ul_TimingInterval;
145
unsigned int ul_RealTimingInterval = 0;
147
i_ReturnValue = insn->n;
148
b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
150
b_TorCounter = (unsigned char) data[0];
151
b_PCIInputClock = (unsigned char) data[1];
152
b_TimingUnit = (unsigned char) data[2];
153
ul_TimingInterval = (unsigned int) data[3];
154
printk("INPUT clock %d\n", b_PCIInputClock);
156
/**************************/
157
/* Test the module number */
158
/**************************/
160
if (b_ModulNbr < 4) {
161
/***********************/
162
/* Test if tor counter */
163
/***********************/
165
if ((devpriv->s_BoardInfos.
166
dw_MolduleConfiguration[b_ModulNbr] &
167
0xFFFF0000UL) == APCI1710_TOR_COUNTER) {
168
/**********************************/
169
/* Test the tor counter selection */
170
/**********************************/
172
if (b_TorCounter <= 1) {
173
/**************************/
174
/* Test the PCI bus clock */
175
/**************************/
177
if ((b_PCIInputClock == APCI1710_30MHZ) ||
178
(b_PCIInputClock == APCI1710_33MHZ) ||
179
(b_PCIInputClock == APCI1710_40MHZ) ||
181
APCI1710_GATE_INPUT)) {
182
/************************/
183
/* Test the timing unit */
184
/************************/
186
if ((b_TimingUnit <= 4)
187
|| (b_PCIInputClock ==
188
APCI1710_GATE_INPUT)) {
189
/**********************************/
190
/* Test the base timing selection */
191
/**********************************/
193
if (((b_PCIInputClock == APCI1710_30MHZ) && (b_TimingUnit == 0) && (ul_TimingInterval >= 133) && (ul_TimingInterval <= 0xFFFFFFFFUL)) || ((b_PCIInputClock == APCI1710_30MHZ) && (b_TimingUnit == 1) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 571230650UL)) || ((b_PCIInputClock == APCI1710_30MHZ) && (b_TimingUnit == 2) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 571230UL)) || ((b_PCIInputClock == APCI1710_30MHZ) && (b_TimingUnit == 3) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 571UL)) || ((b_PCIInputClock == APCI1710_30MHZ) && (b_TimingUnit == 4) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 9UL)) || ((b_PCIInputClock == APCI1710_33MHZ) && (b_TimingUnit == 0) && (ul_TimingInterval >= 121) && (ul_TimingInterval <= 0xFFFFFFFFUL)) || ((b_PCIInputClock == APCI1710_33MHZ) && (b_TimingUnit == 1) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 519691043UL)) || ((b_PCIInputClock == APCI1710_33MHZ) && (b_TimingUnit == 2) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 519691UL)) || ((b_PCIInputClock == APCI1710_33MHZ) && (b_TimingUnit == 3) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 520UL)) || ((b_PCIInputClock == APCI1710_33MHZ) && (b_TimingUnit == 4) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 8UL)) || ((b_PCIInputClock == APCI1710_40MHZ) && (b_TimingUnit == 0) && (ul_TimingInterval >= 100) && (ul_TimingInterval <= 0xFFFFFFFFUL)) || ((b_PCIInputClock == APCI1710_40MHZ) && (b_TimingUnit == 1) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 429496729UL)) || ((b_PCIInputClock == APCI1710_40MHZ) && (b_TimingUnit == 2) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 429496UL)) || ((b_PCIInputClock == APCI1710_40MHZ) && (b_TimingUnit == 3) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 429UL)) || ((b_PCIInputClock == APCI1710_40MHZ) && (b_TimingUnit == 4) && (ul_TimingInterval >= 1) && (ul_TimingInterval <= 7UL)) || ((b_PCIInputClock == APCI1710_GATE_INPUT) && (ul_TimingInterval >= 2))) {
194
/**************************/
195
/* Test the board version */
196
/**************************/
198
if (((b_PCIInputClock == APCI1710_40MHZ) && (devpriv->s_BoardInfos.b_BoardVersion > 0)) || (b_PCIInputClock != APCI1710_40MHZ)) {
199
/************************/
200
/* Test the TOR version */
201
/************************/
203
if (((b_PCIInputClock == APCI1710_40MHZ) && ((devpriv->s_BoardInfos.dw_MolduleConfiguration[b_ModulNbr] & 0xFFFF) >= 0x3131)) || ((b_PCIInputClock == APCI1710_GATE_INPUT) && ((devpriv->s_BoardInfos.dw_MolduleConfiguration[b_ModulNbr] & 0xFFFF) >= 0x3132)) || (b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) {
204
/*********************************/
205
/* Test if not extern clock used */
206
/*********************************/
208
if (b_PCIInputClock != APCI1710_GATE_INPUT) {
211
/****************************************/
212
/* Calculate the timer 0 division fator */
213
/****************************************/
215
switch (b_TimingUnit) {
231
(0.00025 * b_PCIInputClock));
233
/*******************/
234
/* Round the value */
235
/*******************/
237
if ((double)((double)ul_TimingInterval * (0.00025 * (double)b_PCIInputClock)) >= ((double)((double)ul_TimerValue + 0.5))) {
245
/*****************************/
246
/* Calculate the real timing */
247
/*****************************/
249
ul_RealTimingInterval
254
(0.00025 * (double)b_PCIInputClock));
265
if ((double)((double)ul_TimerValue / (0.00025 * (double)b_PCIInputClock)) >= (double)((double)ul_RealTimingInterval + 0.5)) {
266
ul_RealTimingInterval
268
ul_RealTimingInterval
284
if (b_PCIInputClock != APCI1710_40MHZ) {
312
(0.25 * b_PCIInputClock));
314
/*******************/
315
/* Round the value */
316
/*******************/
318
if ((double)((double)ul_TimingInterval * (0.25 * (double)b_PCIInputClock)) >= ((double)((double)ul_TimerValue + 0.5))) {
326
/*****************************/
327
/* Calculate the real timing */
328
/*****************************/
330
ul_RealTimingInterval
335
(0.25 * (double)b_PCIInputClock));
348
if ((double)((double)ul_TimerValue / (0.25 * (double)b_PCIInputClock)) >= (double)((double)ul_RealTimingInterval + 0.5)) {
349
ul_RealTimingInterval
351
ul_RealTimingInterval
367
if (b_PCIInputClock != APCI1710_40MHZ) {
398
/*******************/
399
/* Round the value */
400
/*******************/
402
if ((double)((double)ul_TimingInterval * (250.0 * (double)b_PCIInputClock)) >= ((double)((double)ul_TimerValue + 0.5))) {
410
/*****************************/
411
/* Calculate the real timing */
412
/*****************************/
414
ul_RealTimingInterval
419
(250.0 * (double)b_PCIInputClock));
430
if ((double)((double)ul_TimerValue / (250.0 * (double)b_PCIInputClock)) >= (double)((double)ul_RealTimingInterval + 0.5)) {
431
ul_RealTimingInterval
433
ul_RealTimingInterval
449
if (b_PCIInputClock != APCI1710_40MHZ) {
481
/*******************/
482
/* Round the value */
483
/*******************/
485
if ((double)((double)ul_TimingInterval * (250000.0 * (double)b_PCIInputClock)) >= ((double)((double)ul_TimerValue + 0.5))) {
493
/*****************************/
494
/* Calculate the real timing */
495
/*****************************/
497
ul_RealTimingInterval
516
if ((double)((double)ul_TimerValue / (250000.0 * (double)b_PCIInputClock)) >= (double)((double)ul_RealTimingInterval + 0.5)) {
517
ul_RealTimingInterval
519
ul_RealTimingInterval
535
if (b_PCIInputClock != APCI1710_40MHZ) {
570
/*******************/
571
/* Round the value */
572
/*******************/
574
if ((double)((double)(ul_TimingInterval * 60.0) * (250000.0 * (double)b_PCIInputClock)) >= ((double)((double)ul_TimerValue + 0.5))) {
582
/*****************************/
583
/* Calculate the real timing */
584
/*****************************/
586
ul_RealTimingInterval
610
if ((double)(((double)ul_TimerValue / (250000.0 * (double)b_PCIInputClock)) / 60.0) >= (double)((double)ul_RealTimingInterval + 0.5)) {
611
ul_RealTimingInterval
613
ul_RealTimingInterval
629
if (b_PCIInputClock != APCI1710_40MHZ) {
644
} /* if (b_PCIInputClock != APCI1710_GATE_INPUT) */
646
/*************************************************************/
647
/* 2 Clock used for the overflow and the reload from counter */
648
/*************************************************************/
655
} /* if (b_PCIInputClock != APCI1710_GATE_INPUT) */
657
/****************************/
658
/* Save the PCI input clock */
659
/****************************/
663
s_TorCounterModuleInfo.
668
/************************/
669
/* Save the timing unit */
670
/************************/
675
s_TorCounterModuleInfo.
682
/************************/
683
/* Save the base timing */
684
/************************/
688
s_TorCounterModuleInfo.
693
d_RealTimingInterval;
698
s_TorCounterModuleInfo.
701
ul_RealTimingInterval
703
ul_RealTimingInterval;
705
/*******************/
706
/* Get the command */
707
/*******************/
718
(16 * b_TorCounter) + (64 * b_ModulNbr));
732
if (b_PCIInputClock == APCI1710_40MHZ) {
733
/****************************/
734
/* Set the 40 MHz selection */
735
/****************************/
744
/*****************************/
745
/* Test if extern clock used */
746
/*****************************/
748
if (b_PCIInputClock == APCI1710_GATE_INPUT) {
749
/****************************/
750
/* Set the 40 MHz selection */
751
/****************************/
760
/*************************/
761
/* Write the new command */
762
/*************************/
764
outl(dw_Command, devpriv->s_BoardInfos.ui_Address + 4 + (16 * b_TorCounter) + (64 * b_ModulNbr));
766
/*******************/
767
/* Disable the tor */
768
/*******************/
770
outl(0, devpriv->s_BoardInfos.ui_Address + 8 + (16 * b_TorCounter) + (64 * b_ModulNbr));
771
/*************************/
772
/* Set the timer 1 value */
773
/*************************/
775
outl(ul_TimerValue, devpriv->s_BoardInfos.ui_Address + 0 + (16 * b_TorCounter) + (64 * b_ModulNbr));
777
/*********************/
778
/* Tor counter init. */
779
/*********************/
784
s_TorCounterModuleInfo.
791
/***********************************************/
792
/* TOR version error for 40MHz clock selection */
793
/***********************************************/
795
DPRINTK("TOR version error for 40MHz clock selection\n");
801
/**************************************************************/
802
/* You can not used the 40MHz clock selection wich this board */
803
/**************************************************************/
805
DPRINTK("You can not used the 40MHz clock selection wich this board\n");
810
/**********************************/
811
/* Base timing selection is wrong */
812
/**********************************/
814
DPRINTK("Base timing selection is wrong\n");
817
} /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */
819
/**********************************/
820
/* Timing unit selection is wrong */
821
/**********************************/
823
DPRINTK("Timing unit selection is wrong\n");
825
} /* if ((b_TimingUnit >= 0) && (b_TimingUnit <= 4)) */
826
} /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */
828
/*****************************************/
829
/* The selected PCI input clock is wrong */
830
/*****************************************/
832
DPRINTK("The selected PCI input clock is wrong\n");
834
} /* if ((b_PCIInputClock == APCI1710_30MHZ) || (b_PCIInputClock == APCI1710_33MHZ)) */
835
} /* if (b_TorCounterMode >= 0 && b_TorCounterMode <= 7) */
837
/**********************************/
838
/* Tor Counter selection is wrong */
839
/**********************************/
841
DPRINTK("Tor Counter selection is wrong\n");
843
} /* if (b_TorCounterMode >= 0 && b_TorCounterMode <= 7) */
845
/******************************************/
846
/* The module is not a tor counter module */
847
/******************************************/
849
DPRINTK("The module is not a tor counter module\n");
853
/***********************/
854
/* Module number error */
855
/***********************/
857
DPRINTK("Module number error\n");
860
data[0] = (unsigned int) ul_RealTimingInterval;
861
return i_ReturnValue;
865
+----------------------------------------------------------------------------+
866
| Function Name : _INT_ i_APCI1710_EnableTorCounter |
867
| (unsigned char_ b_BoardHandle, |
868
| unsigned char_ b_ModulNbr, |
869
| unsigned char_ b_TorCounter, |
870
| unsigned char_ b_InputMode, |
871
| unsigned char_ b_ExternGate, |
872
| unsigned char_ b_CycleMode, |
873
| unsigned char_ b_InterruptEnable) |
874
+----------------------------------------------------------------------------+
875
| Task : Enable the tor counter (b_TorCounter) from selected |
876
| module (b_ModulNbr). You must calling the |
877
| "i_APCI1710_InitTorCounter" function be for you call |
879
| If you enable the tor counter interrupt, the |
880
| tor counter generate a interrupt after the timing cycle|
881
| See function "i_APCI1710_SetBoardIntRoutineX" and the |
882
| Interrupt mask description chapter from this manual. |
883
| The b_CycleMode parameter determine if you will |
884
| measured a single or more cycle. |
885
+----------------------------------------------------------------------------+
886
| Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710 |
887
| unsigned char_ b_ModulNbr : Selected module number (0 to 3) |
888
| unsigned char_ b_TorCounter : Tor counter selection (0 or 1). |
889
| unsigned char_ b_InputMode : Input signal level selection |
890
| 0 : Tor count each low level |
891
| 1 : Tor count each high level|
892
| unsigned char_ b_ExternGate : Extern gate action selection |
893
| 0 : Extern gate signal not |
895
| 1 : Extern gate signal used. |
896
| If you selected the |
897
| single mode, each high |
898
| level signal start the |
900
| If you selected the |
901
| continuous mode, the |
902
| first high level signal |
903
| start the tor counter |
905
| APCI1710_TOR_QUADRUPLE _MODE : |
906
| In the quadruple mode, the edge|
907
| analysis circuit generates a |
908
| counting pulse from each edge |
909
| of 2 signals which are phase |
910
| shifted in relation to each |
912
| The gate input is used for the |
915
| APCI1710_TOR_DOUBLE_MODE: |
916
| Functions in the same way as |
917
| the quadruple mode, except that|
918
| only two of the four edges are |
919
| analysed per period. |
920
| The gate input is used for the |
923
| APCI1710_TOR_SIMPLE_MODE: |
924
| Functions in the same way as |
925
| the quadruple mode, except that|
926
| only one of the four edges is |
927
| analysed per period. |
928
| The gate input is used for the |
931
| unsigned char_ b_CycleMode : Selected the tor counter |
933
| unsigned char_ b_InterruptEnable : Enable or disable the |
934
| tor counter interrupt. |
936
| Enable the tor counter |
938
| APCI1710_DISABLE: |
939
| Disable the tor counter |
941
+----------------------------------------------------------------------------+
942
| Output Parameters : - |
943
+----------------------------------------------------------------------------+
944
| Return Value : 0: No error |
945
| -1: The handle parameter of the board is wrong |
946
| -2: Module selection wrong |
947
| -3: The module is not a tor counter module |
948
| -4: Tor counter selection is wrong |
949
| -5: Tor counter not initialised see function |
950
| "i_APCI1710_InitTorCounter" |
951
| -6: Tor input signal selection is wrong |
952
| -7: Extern gate signal mode is wrong |
953
| -8: Tor counter acquisition mode cycle is wrong |
954
| -9: Interrupt parameter is wrong |
955
| -10:Interrupt function not initialised. |
956
| See function "i_APCI1710_SetBoardIntRoutineX" |
957
+----------------------------------------------------------------------------+
960
+----------------------------------------------------------------------------+
961
| Function Name : _INT_ i_APCI1710_DisableTorCounter |
962
| (unsigned char_ b_BoardHandle, |
963
| unsigned char_ b_ModulNbr, |
964
| unsigned char_ b_TorCounter) |
965
+----------------------------------------------------------------------------+
966
| Task : Disable the tor counter (b_TorCounter) from selected |
967
| module (b_ModulNbr). If you disable the tor counter |
968
| after a start cycle occur and you restart the tor |
969
| counter witch the " i_APCI1710_EnableTorCounter" |
970
| function, the status register is cleared |
971
+----------------------------------------------------------------------------+
972
| Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710 |
973
| unsigned char_ b_ModulNbr : Selected module number (0 to 3) |
974
| unsigned char_ b_TorCounter : Tor counter selection (0 or 1). |
975
+----------------------------------------------------------------------------+
976
| Output Parameters : - |
977
+----------------------------------------------------------------------------+
978
| Return Value : 0: No error |
979
| -1: The handle parameter of the board is wrong |
980
| -2: Module selection wrong |
981
| -3: The module is not a tor counter module |
982
| -4: Tor counter selection is wrong |
983
| -5: Tor counter not initialised see function |
984
| "i_APCI1710_InitTorCounter" |
985
| -6: Tor counter not enabled see function |
986
| "i_APCI1710_EnableTorCounter" |
987
+----------------------------------------------------------------------------+
990
int i_APCI1710_InsnWriteEnableDisableTorCounter(struct comedi_device *dev,
991
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
993
int i_ReturnValue = 0;
994
unsigned int dw_Status;
995
unsigned int dw_DummyRead;
996
unsigned int dw_ConfigReg;
997
unsigned char b_ModulNbr, b_Action;
998
unsigned char b_TorCounter;
999
unsigned char b_InputMode;
1000
unsigned char b_ExternGate;
1001
unsigned char b_CycleMode;
1002
unsigned char b_InterruptEnable;
1004
b_ModulNbr = (unsigned char) CR_AREF(insn->chanspec);
1005
b_Action = (unsigned char) data[0]; /* enable or disable */
1006
b_TorCounter = (unsigned char) data[1];
1007
b_InputMode = (unsigned char) data[2];
1008
b_ExternGate = (unsigned char) data[3];
1009
b_CycleMode = (unsigned char) data[4];
1010
b_InterruptEnable = (unsigned char) data[5];
1011
i_ReturnValue = insn->n;
1012
devpriv->tsk_Current = current; /* Save the current process task structure */
1013
/**************************/
1014
/* Test the module number */
1015
/**************************/
1017
if (b_ModulNbr < 4) {
1018
/***********************/
1019
/* Test if tor counter */
1020
/***********************/
1022
if ((devpriv->s_BoardInfos.
1023
dw_MolduleConfiguration[b_ModulNbr] &
1024
0xFFFF0000UL) == APCI1710_TOR_COUNTER) {
1025
/**********************************/
1026
/* Test the tor counter selection */
1027
/**********************************/
1029
if (b_TorCounter <= 1) {
1030
switch (b_Action) /* Enable or Disable */
1032
case APCI1710_ENABLE:
1033
/***********************************/
1034
/* Test if tor counter initialised */
1035
/***********************************/
1038
inl(devpriv->s_BoardInfos.
1040
(16 * b_TorCounter) +
1043
if (dw_Status & 0x10) {
1044
/******************************/
1045
/* Test the input signal mode */
1046
/******************************/
1048
if (b_InputMode == 0 ||
1051
APCI1710_TOR_SIMPLE_MODE
1053
APCI1710_TOR_DOUBLE_MODE
1055
APCI1710_TOR_QUADRUPLE_MODE)
1057
/************************************/
1058
/* Test the extern gate signal mode */
1059
/************************************/
1061
if (b_ExternGate == 0
1066
/*********************************/
1067
/* Test the cycle mode parameter */
1068
/*********************************/
1070
if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) {
1071
/***************************/
1072
/* Test the interrupt flag */
1073
/***************************/
1075
if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) {
1077
/***************************/
1078
/* Save the interrupt mode */
1079
/***************************/
1084
s_TorCounterModuleInfo.
1091
/*******************/
1092
/* Get the command */
1093
/*******************/
1104
(16 * b_TorCounter) + (64 * b_ModulNbr));
1114
/********************************/
1115
/* Test if not direct mode used */
1116
/********************************/
1118
if (b_InputMode > 1) {
1119
/*******************************/
1120
/* Extern gate can not be used */
1121
/*******************************/
1127
/*******************************************/
1128
/* Enable the extern gate for the Signal B */
1129
/*******************************************/
1137
/***********************/
1138
/* Test if simple mode */
1139
/***********************/
1141
if (b_InputMode == APCI1710_TOR_SIMPLE_MODE) {
1142
/**************************/
1143
/* Enable the sinple mode */
1144
/**************************/
1152
} /* if (b_InputMode == APCI1710_TOR_SIMPLE_MODE) */
1154
/***********************/
1155
/* Test if double mode */
1156
/***********************/
1158
if (b_InputMode == APCI1710_TOR_DOUBLE_MODE) {
1159
/**************************/
1160
/* Enable the double mode */
1161
/**************************/
1169
} /* if (b_InputMode == APCI1710_TOR_DOUBLE_MODE) */
1174
} /* if (b_InputMode > 1) */
1176
/*******************/
1177
/* Set the command */
1178
/*******************/
1198
/*****************************/
1199
/* Clear the status register */
1200
/*****************************/
1211
(16 * b_TorCounter) + (64 * b_ModulNbr));
1213
/***************************************/
1214
/* Clear the interrupt status register */
1215
/***************************************/
1226
(16 * b_TorCounter) + (64 * b_ModulNbr));
1228
/********************/
1229
/* Set the commando */
1230
/********************/
1232
outl(dw_ConfigReg, devpriv->s_BoardInfos.ui_Address + 4 + (16 * b_TorCounter) + (64 * b_ModulNbr));
1238
outl(1, devpriv->s_BoardInfos.ui_Address + 8 + (16 * b_TorCounter) + (64 * b_ModulNbr));
1240
} /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */
1242
/********************************/
1243
/* Interrupt parameter is wrong */
1244
/********************************/
1246
DPRINTK("Interrupt parameter is wrong\n");
1250
} /* if ((b_InterruptEnable == APCI1710_ENABLE) || (b_InterruptEnable == APCI1710_DISABLE)) */
1251
} /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */
1253
/***********************************************/
1254
/* Tor counter acquisition mode cycle is wrong */
1255
/***********************************************/
1257
DPRINTK("Tor counter acquisition mode cycle is wrong\n");
1261
} /* if ((b_CycleMode == APCI1710_SINGLE) || (b_CycleMode == APCI1710_CONTINUOUS)) */
1262
} /* if (b_ExternGate >= 0 && b_ExternGate <= 1) */
1264
/***********************************/
1265
/* Extern gate input mode is wrong */
1266
/***********************************/
1268
DPRINTK("Extern gate input mode is wrong\n");
1271
} /* if (b_ExternGate >= 0 && b_ExternGate <= 1) */
1272
} /* if (b_InputMode >= 0 && b_InputMode <= 1) */
1274
/***************************************/
1275
/* Tor input signal selection is wrong */
1276
/***************************************/
1278
DPRINTK("Tor input signal selection is wrong\n");
1282
/*******************************/
1283
/* Tor counter not initialised */
1284
/*******************************/
1286
DPRINTK("Tor counter not initialised\n");
1291
case APCI1710_DISABLE:
1292
/***********************************/
1293
/* Test if tor counter initialised */
1294
/***********************************/
1296
dw_Status = inl(devpriv->s_BoardInfos.
1298
(16 * b_TorCounter) +
1301
/*******************************/
1302
/* Test if counter initialised */
1303
/*******************************/
1305
if (dw_Status & 0x10) {
1306
/***************************/
1307
/* Test if counter enabled */
1308
/***************************/
1310
if (dw_Status & 0x1) {
1311
/****************************/
1312
/* Clear the interrupt mode */
1313
/****************************/
1317
s_TorCounterModuleInfo.
1324
/******************/
1325
/* Clear the gate */
1326
/******************/
1331
(16 * b_TorCounter) + (64 * b_ModulNbr));
1332
} /* if (dw_Status & 0x1) */
1334
/***************************/
1335
/* Tor counter not enabled */
1336
/***************************/
1338
DPRINTK("Tor counter not enabled \n");
1340
} /* if (dw_Status & 0x1) */
1341
} /* if (dw_Status & 0x10) */
1343
/*******************************/
1344
/* Tor counter not initialised */
1345
/*******************************/
1347
DPRINTK("Tor counter not initialised\n");
1349
} /* // if (dw_Status & 0x10) */
1352
} /* if (b_TorCounter <= 1) */
1354
/**********************************/
1355
/* Tor counter selection is wrong */
1356
/**********************************/
1358
DPRINTK("Tor counter selection is wrong\n");
1360
} /* if (b_TorCounter <= 1) */
1362
/******************************************/
1363
/* The module is not a tor counter module */
1364
/******************************************/
1366
DPRINTK("The module is not a tor counter module \n");
1370
/***********************/
1371
/* Module number error */
1372
/***********************/
1374
DPRINTK("Module number error \n");
1378
return i_ReturnValue;
1382
+----------------------------------------------------------------------------+
1383
| Function Name : _INT_ i_APCI1710_GetTorCounterInitialisation |
1384
| (unsigned char_ b_BoardHandle, |
1385
| unsigned char_ b_ModulNbr, |
1386
| unsigned char_ b_TorCounter, |
1387
| unsigned char *_ pb_TimingUnit, |
1388
| PULONG_ pul_TimingInterval, |
1389
| unsigned char *_ pb_InputMode, |
1390
| unsigned char *_ pb_ExternGate, |
1391
| unsigned char *_ pb_CycleMode, |
1392
| unsigned char *_ pb_Enable, |
1393
| unsigned char *_ pb_InterruptEnable)|
1394
+----------------------------------------------------------------------------+
1395
| Task : Enable the tor counter (b_TorCounter) from selected |
1396
| module (b_ModulNbr). You must calling the |
1397
| "i_APCI1710_InitTorCounter" function be for you call |
1399
| If you enable the tor counter interrupt, the |
1400
| tor counter generate a interrupt after the timing cycle|
1401
| See function "i_APCI1710_SetBoardIntRoutineX" and the |
1402
| Interrupt mask description chapter from this manual. |
1403
| The b_CycleMode parameter determine if you will |
1404
| measured a single or more cycle. |
1405
+----------------------------------------------------------------------------+
1406
| Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710 |
1407
| unsigned char_ b_ModulNbr : Selected module number (0 to 3) |
1408
| unsigned char_ b_TorCounter : Tor counter selection (0 or 1)
1410
b_ModulNbr = CR_AREF(insn->chanspec);
1411
b_TorCounter = CR_CHAN(insn->chanspec);
1413
+----------------------------------------------------------------------------+
1414
| Output Parameters : unsigned char *_ pb_TimingUnit : Base timing unit (0 to 4) |
1420
| PULONG_ pul_TimingInterval : Base timing value. |
1421
| unsigned char *_ pb_InputMode : Input signal level |
1423
| 0 : Tor count each low level |
1424
| 1 : Tor count each high level|
1425
| unsigned char *_ pb_ExternGate : Extern gate action |
1427
| 0 : Extern gate signal not |
1429
| 1 : Extern gate signal used|
1430
| unsigned char *_ pb_CycleMode : Tor counter acquisition |
1432
| unsigned char *_ pb_Enable : Indicate if the tor counter|
1433
| is enabled or no |
1434
| 0 : Tor counter disabled |
1435
| 1 : Tor counter enabled |
1436
| unsigned char *_ pb_InterruptEnable : Enable or disable the |
1437
| tor counter interrupt. |
1438
| APCI1710_ENABLE: |
1439
| Enable the tor counter |
1441
| APCI1710_DISABLE: |
1442
| Disable the tor counter |
1444
pb_TimingUnit = (unsigned char *) &data[0];
1445
pul_TimingInterval = (unsigned int *) &data[1];
1446
pb_InputMode = (unsigned char *) &data[2];
1447
pb_ExternGate = (unsigned char *) &data[3];
1448
pb_CycleMode = (unsigned char *) &data[4];
1449
pb_Enable = (unsigned char *) &data[5];
1450
pb_InterruptEnable = (unsigned char *) &data[6];
1452
+----------------------------------------------------------------------------+
1453
| Return Value : 0: No error |
1454
| -1: The handle parameter of the board is wrong |
1455
| -2: Module selection wrong |
1456
| -3: The module is not a tor counter module |
1457
| -4: Tor counter selection is wrong |
1458
| -5: Tor counter not initialised see function |
1459
| "i_APCI1710_InitTorCounter" |
1460
+----------------------------------------------------------------------------+
1463
int i_APCI1710_InsnReadGetTorCounterInitialisation(struct comedi_device *dev,
1464
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
1466
int i_ReturnValue = 0;
1467
unsigned int dw_Status;
1468
unsigned char b_ModulNbr;
1469
unsigned char b_TorCounter;
1470
unsigned char *pb_TimingUnit;
1471
unsigned int *pul_TimingInterval;
1472
unsigned char *pb_InputMode;
1473
unsigned char *pb_ExternGate;
1474
unsigned char *pb_CycleMode;
1475
unsigned char *pb_Enable;
1476
unsigned char *pb_InterruptEnable;
1478
i_ReturnValue = insn->n;
1479
b_ModulNbr = CR_AREF(insn->chanspec);
1480
b_TorCounter = CR_CHAN(insn->chanspec);
1482
pb_TimingUnit = (unsigned char *) &data[0];
1483
pul_TimingInterval = (unsigned int *) &data[1];
1484
pb_InputMode = (unsigned char *) &data[2];
1485
pb_ExternGate = (unsigned char *) &data[3];
1486
pb_CycleMode = (unsigned char *) &data[4];
1487
pb_Enable = (unsigned char *) &data[5];
1488
pb_InterruptEnable = (unsigned char *) &data[6];
1490
/**************************/
1491
/* Test the module number */
1492
/**************************/
1494
if (b_ModulNbr < 4) {
1495
/***********************/
1496
/* Test if tor counter */
1497
/***********************/
1499
if ((devpriv->s_BoardInfos.
1500
dw_MolduleConfiguration[b_ModulNbr] &
1501
0xFFFF0000UL) == APCI1710_TOR_COUNTER) {
1502
/**********************************/
1503
/* Test the tor counter selection */
1504
/**********************************/
1506
if (b_TorCounter <= 1) {
1508
/***********************************/
1509
/* Test if tor counter initialised */
1510
/***********************************/
1512
dw_Status = inl(devpriv->s_BoardInfos.
1513
ui_Address + 8 + (16 * b_TorCounter) +
1516
if (dw_Status & 0x10) {
1517
*pb_Enable = dw_Status & 1;
1519
/********************/
1520
/* Get the commando */
1521
/********************/
1523
dw_Status = inl(devpriv->s_BoardInfos.
1525
(16 * b_TorCounter) +
1529
(unsigned char) ((dw_Status >> 4) & 1);
1530
*pb_InterruptEnable =
1531
(unsigned char) ((dw_Status >> 5) & 1);
1533
/******************************************************/
1534
/* Test if extern gate used for clock or for signal B */
1535
/******************************************************/
1537
if (dw_Status & 0x600) {
1538
/*****************************************/
1539
/* Test if extern gate used for signal B */
1540
/*****************************************/
1542
if (dw_Status & 0x400) {
1543
/***********************/
1544
/* Test if simple mode */
1545
/***********************/
1547
if ((dw_Status & 0x7800)
1550
APCI1710_TOR_SIMPLE_MODE;
1553
/***********************/
1554
/* Test if double mode */
1555
/***********************/
1557
if ((dw_Status & 0x7800)
1560
APCI1710_TOR_DOUBLE_MODE;
1563
/**************************/
1564
/* Test if quadruple mode */
1565
/**************************/
1567
if ((dw_Status & 0x7800)
1570
APCI1710_TOR_QUADRUPLE_MODE;
1572
} /* if (dw_Status & 0x400) */
1575
} /* // if (dw_Status & 0x400) */
1577
/************************/
1578
/* Extern gate not used */
1579
/************************/
1582
} /* if (dw_Status & 0x600) */
1585
(unsigned char) ((dw_Status >> 6)
1588
(unsigned char) ((dw_Status >> 7)
1590
} /* if (dw_Status & 0x600) */
1594
s_ModuleInfo[b_ModulNbr].
1595
s_TorCounterModuleInfo.
1596
s_TorCounterInfo[b_TorCounter].
1599
*pul_TimingInterval =
1601
s_ModuleInfo[b_ModulNbr].
1602
s_TorCounterModuleInfo.
1603
s_TorCounterInfo[b_TorCounter].
1604
ul_RealTimingInterval;
1606
/*******************************/
1607
/* Tor counter not initialised */
1608
/*******************************/
1610
DPRINTK("Tor counter not initialised\n");
1614
} /* if (b_TorCounter <= 1) */
1616
/**********************************/
1617
/* Tor counter selection is wrong */
1618
/**********************************/
1620
DPRINTK("Tor counter selection is wrong \n");
1622
} /* if (b_TorCounter <= 1) */
1624
/******************************************/
1625
/* The module is not a tor counter module */
1626
/******************************************/
1628
DPRINTK("The module is not a tor counter module\n");
1632
/***********************/
1633
/* Module number error */
1634
/***********************/
1636
DPRINTK("Module number error\n");
1640
return i_ReturnValue;
1644
+----------------------------------------------------------------------------+
1645
| Function Name : _INT_ i_APCI1710_ReadTorCounterValue |
1646
| (unsigned char_ b_BoardHandle, |
1647
| unsigned char_ b_ModulNbr, |
1648
| unsigned char_ b_TorCounter, |
1649
| unsigned int_ ui_TimeOut, |
1650
| unsigned char *_ pb_TorCounterStatus, |
1651
| PULONG_ pul_TorCounterValue) |
1652
+----------------------------------------------------------------------------+
1653
| Task case APCI1710_TOR_GETPROGRESSSTATUS: Return the tor counter
1654
(b_TorCounter) status (pb_TorCounterStatus) from selected tor counter |
1655
| module (b_ModulNbr).
1657
case APCI1710_TOR_GETCOUNTERVALUE :
1658
Return the tor counter (b_TorCounter) status |
1659
| (pb_TorCounterStatus) and the timing value |
1660
| (pul_TorCounterValue) after a conting cycle stop |
1661
| from selected tor counter module (b_ModulNbr). |
1662
+----------------------------------------------------------------------------+
1663
| Input Parameters : unsigned char_ b_BoardHandle : Handle of board APCI-1710 |
1664
| unsigned char_ b_ModulNbr : Selected module number (0 to 3) |
1665
| unsigned char_ b_TorCounter : Tor counter selection (0 or 1).
1666
b_ModulNbr = CR_AREF(insn->chanspec);
1667
b_ReadType = (unsigned char) data[0];
1668
b_TorCounter = (unsigned char) data[1];
1669
ui_TimeOut = (unsigned int) data[2]; |
1670
+----------------------------------------------------------------------------+
1671
| Output Parameters : unsigned char *_ pb_TorCounterStatus : Return the tor counter |
1673
| 0 : Conting cycle not started|
1674
| Software gate not set. |
1675
| 1 : Conting cycle started. |
1676
| Software gate set. |
1677
| 2 : Conting cycle stopped. |
1678
| The conting cycle is |
1680
| 3 : A overflow occur. You |
1681
| must change the base |
1682
| timing witch the |
1684
| "i_APCI1710_InitTorCounter"|
1685
| 4 : Timeeout occur |
1686
| unsigned int * pul_TorCounterValue : Tor counter value.
1687
pb_TorCounterStatus=(unsigned char *) &data[0];
1688
pul_TorCounterValue=(unsigned int *) &data[1]; |
1689
+----------------------------------------------------------------------------+
1690
| Return Value : 0: No error |
1691
| -1: The handle parameter of the board is wrong |
1692
| -2: Module selection wrong |
1693
| -3: The module is not a tor counter module |
1694
| -4: Tor counter selection is wrong |
1695
| -5: Tor counter not initialised see function |
1696
| "i_APCI1710_InitTorCounter" |
1697
| -6: Tor counter not enabled see function |
1698
| "i_APCI1710_EnableTorCounter" |
1699
| -7: Timeout parameter is wrong (0 to 65535) |
1700
+----------------------------------------------------------------------------+
1703
int i_APCI1710_InsnBitsGetTorCounterProgressStatusAndValue(struct comedi_device *dev,
1704
struct comedi_subdevice *s, struct comedi_insn *insn, unsigned int *data)
1706
int i_ReturnValue = 0;
1707
unsigned int dw_Status;
1708
unsigned int dw_TimeOut = 0;
1710
unsigned char b_ModulNbr;
1711
unsigned char b_TorCounter;
1712
unsigned char b_ReadType;
1713
unsigned int ui_TimeOut;
1714
unsigned char *pb_TorCounterStatus;
1715
unsigned int *pul_TorCounterValue;
1717
i_ReturnValue = insn->n;
1718
b_ModulNbr = CR_AREF(insn->chanspec);
1719
b_ReadType = (unsigned char) data[0];
1720
b_TorCounter = (unsigned char) data[1];
1721
ui_TimeOut = (unsigned int) data[2];
1722
pb_TorCounterStatus = (unsigned char *) &data[0];
1723
pul_TorCounterValue = (unsigned int *) &data[1];
1725
/**************************/
1726
/* Test the module number */
1727
/**************************/
1729
if (b_ReadType == APCI1710_TOR_READINTERRUPT) {
1731
data[0] = devpriv->s_InterruptParameters.
1732
s_FIFOInterruptParameters[devpriv->
1733
s_InterruptParameters.ui_Read].b_OldModuleMask;
1734
data[1] = devpriv->s_InterruptParameters.
1735
s_FIFOInterruptParameters[devpriv->
1736
s_InterruptParameters.ui_Read].ul_OldInterruptMask;
1737
data[2] = devpriv->s_InterruptParameters.
1738
s_FIFOInterruptParameters[devpriv->
1739
s_InterruptParameters.ui_Read].ul_OldCounterLatchValue;
1741
/**************************/
1742
/* Increment the read FIFO */
1743
/***************************/
1746
s_InterruptParameters.
1747
ui_Read = (devpriv->
1748
s_InterruptParameters.
1749
ui_Read + 1) % APCI1710_SAVE_INTERRUPT;
1754
if (b_ModulNbr < 4) {
1755
/***********************/
1756
/* Test if tor counter */
1757
/***********************/
1759
if ((devpriv->s_BoardInfos.
1760
dw_MolduleConfiguration[b_ModulNbr] &
1761
0xFFFF0000UL) == APCI1710_TOR_COUNTER) {
1762
/**********************************/
1763
/* Test the tor counter selection */
1764
/**********************************/
1766
if (b_TorCounter <= 1) {
1767
/***********************************/
1768
/* Test if tor counter initialised */
1769
/***********************************/
1771
dw_Status = inl(devpriv->s_BoardInfos.
1772
ui_Address + 8 + (16 * b_TorCounter) +
1775
/*******************************/
1776
/* Test if counter initialised */
1777
/*******************************/
1779
if (dw_Status & 0x10) {
1780
/***************************/
1781
/* Test if counter enabled */
1782
/***************************/
1784
if (dw_Status & 0x1) {
1786
switch (b_ReadType) {
1788
case APCI1710_TOR_GETPROGRESSSTATUS:
1789
/*******************/
1790
/* Read the status */
1791
/*******************/
1797
(16 * b_TorCounter) + (64 * b_ModulNbr));
1806
if (dw_Status & 1) {
1809
if (dw_Status & 4) {
1810
/************************/
1811
/* Tor counter overflow */
1812
/************************/
1814
*pb_TorCounterStatus
1818
/***********************/
1819
/* Tor counter started */
1820
/***********************/
1822
*pb_TorCounterStatus
1827
/***********************/
1828
/* Tor counter started */
1829
/***********************/
1831
*pb_TorCounterStatus
1836
/***************************/
1837
/* Tor counter not started */
1838
/***************************/
1840
*pb_TorCounterStatus
1845
case APCI1710_TOR_GETCOUNTERVALUE:
1847
/*****************************/
1848
/* Test the timout parameter */
1849
/*****************************/
1851
if ((ui_TimeOut >= 0)
1857
/*******************/
1858
/* Read the status */
1859
/*******************/
1870
(16 * b_TorCounter) + (64 * b_ModulNbr));
1871
/********************/
1872
/* Test if overflow */
1873
/********************/
1875
if ((dw_Status & 4) == 4) {
1876
/******************/
1877
/* Overflow occur */
1878
/******************/
1880
*pb_TorCounterStatus
1884
/******************/
1885
/* Read the value */
1886
/******************/
1888
*pul_TorCounterValue
1897
(16 * b_TorCounter) + (64 * b_ModulNbr));
1899
} /* if ((dw_Status & 4) == 4) */
1901
/*******************************/
1902
/* Test if measurement stopped */
1903
/*******************************/
1905
if ((dw_Status & 2) == 2) {
1906
/***********************/
1907
/* A stop signal occur */
1908
/***********************/
1910
*pb_TorCounterStatus
1914
/******************/
1915
/* Read the value */
1916
/******************/
1918
*pul_TorCounterValue
1927
(16 * b_TorCounter) + (64 * b_ModulNbr));
1930
} /* if ((dw_Status & 2) == 2) */
1932
/*******************************/
1933
/* Test if measurement started */
1934
/*******************************/
1936
if ((dw_Status & 1) == 1) {
1937
/************************/
1938
/* A start signal occur */
1939
/************************/
1941
*pb_TorCounterStatus
1944
} /* if ((dw_Status & 1) == 1) */
1946
/***************************/
1947
/* Measurement not started */
1948
/***************************/
1950
*pb_TorCounterStatus
1953
} /* if ((dw_Status & 1) == 1) */
1954
} /* if ((dw_Status & 2) == 2) */
1955
} /* if ((dw_Status & 8) == 8) */
1957
if (dw_TimeOut == ui_TimeOut) {
1964
/*************************/
1965
/* Increment the timeout */
1966
/*************************/
1978
/*************************/
1979
/* Test if timeout occur */
1980
/*************************/
1982
if ((*pb_TorCounterStatus != 3) && (dw_TimeOut == ui_TimeOut) && (ui_TimeOut != 0)) {
1987
*pb_TorCounterStatus
1992
/******************************/
1993
/* Timeout parameter is wrong */
1994
/******************************/
1996
DPRINTK("Timeout parameter is wrong\n");
2003
printk("Inputs wrong\n");
2005
} /* if (dw_Status & 0x1) */
2007
/***************************/
2008
/* Tor counter not enabled */
2009
/***************************/
2011
DPRINTK("Tor counter not enabled\n");
2013
} /* if (dw_Status & 0x1) */
2015
/*******************************/
2016
/* Tor counter not initialised */
2017
/*******************************/
2019
DPRINTK("Tor counter not initialised\n");
2022
} /* if (b_TorCounter <= 1) */
2024
/**********************************/
2025
/* Tor counter selection is wrong */
2026
/**********************************/
2028
DPRINTK("Tor counter selection is wrong\n");
2030
} /* if (b_TorCounter <= 1) */
2032
/******************************************/
2033
/* The module is not a tor counter module */
2034
/******************************************/
2036
DPRINTK("The module is not a tor counter module\n");
2040
/***********************/
2041
/* Module number error */
2042
/***********************/
2044
DPRINTK("Module number error\n");
2048
return i_ReturnValue;