229 unsigned char b_TimerMode;
230 unsigned int ul_ReloadValue;
231 unsigned char b_InputClockSelection;
232 unsigned char b_InputClockLevel;
233 unsigned char b_OutputLevel;
234 unsigned char b_HardwareGateLevel;
237 unsigned int dw_Test = 0;
240 i_ReturnValue = insn->
n;
243 b_TimerMode = (
unsigned char) data[0];
244 ul_ReloadValue = (
unsigned int) data[1];
245 b_InputClockSelection = (
unsigned char) data[2];
246 b_InputClockLevel = (
unsigned char) data[3];
247 b_OutputLevel = (
unsigned char) data[4];
248 b_HardwareGateLevel = (
unsigned char) data[5];
251 if (b_ModulNbr < 4) {
256 if (b_TimerNbr <= 2) {
258 if (b_TimerMode <= 5) {
266 if (((b_TimerNbr == 0) &&
268 ((b_TimerNbr == 0) &&
270 ((b_TimerNbr != 0) &&
281 if ((b_InputClockLevel == 0) ||
282 (b_InputClockLevel == 1)) {
284 if ((b_OutputLevel == 0) || (b_OutputLevel == 1)) {
286 if ((b_HardwareGateLevel == 0) || (b_HardwareGateLevel == 1)) {
291 dw_Test =
inl(
devpriv->s_BoardInfos.ui_Address + (16 + (b_TimerNbr * 4) + (64 * b_ModulNbr)));
293 dw_Test = (dw_Test >> 16) & 1;
329 b_InputClockSelection = 2;
332 devpriv->s_ModuleInfo[
b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[
b_TimerNbr].dw_ConfigurationWord = (
unsigned int)(((b_HardwareGateLevel << 0) & 0x1) | ((b_InputClockLevel << 1) & 0x2) | (((~b_OutputLevel & 1) << 2) & 0x4) | ((b_InputClockSelection << 4) & 0x30));
334 outl(
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].dw_ConfigurationWord,
devpriv->s_BoardInfos.ui_Address + 32 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
337 outl((
unsigned int) b_TimerMode,
devpriv->s_BoardInfos.ui_Address + 16 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
340 outl(ul_ReloadValue,
devpriv->s_BoardInfos.ui_Address + 0 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
351 DPRINTK(
"Selection from hardware gate level is wrong\n");
357 DPRINTK(
"Selection from output clock level is wrong\n");
363 DPRINTK(
"Selection from input clock level is wrong\n");
368 DPRINTK(
"Input timer clock selection is wrong\n");
373 DPRINTK(
"Input timer clock selection is wrong\n");
379 DPRINTK(
"Timer mode selection is wrong\n");
385 DPRINTK(
"Timer selection wrong\n");
390 DPRINTK(
"The module is not a TIMER module\n");
395 DPRINTK(
"Module number error\n");
435 +----------------------------------------------------------------------------+
437 +----------------------------------------------------------------------------+
440 | -2: Module selection wrong |
441 | -3:
Timer selection wrong |
443 | -5:
Timer not initialised see
function |
444 |
"i_APCI1710_InitTimer" |
445 | -6: Interrupt parameter
is wrong |
446 | -7: Interrupt
function not initialised. |
447 | See
function "i_APCI1710_SetBoardIntRoutineX" |
448 +----------------------------------------------------------------------------+
462 i_ReturnValue = insn->
n;
465 b_ActionType = (
unsigned char) data[0];
468 if (b_ModulNbr < 4) {
472 if (b_TimerNbr <= 2) {
474 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].b_82X54Init == 1) {
476 switch (b_ActionType) {
478 b_InterruptEnable = (
unsigned char) data[1];
484 dw_DummyRead =
inl(
devpriv->s_BoardInfos.ui_Address + 12 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
489 outl(
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].dw_ConfigurationWord,
devpriv->s_BoardInfos.ui_Address + 32 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
497 outl(
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].dw_ConfigurationWord,
devpriv->s_BoardInfos.ui_Address + 32 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
504 if (i_ReturnValue >= 0) {
509 outl(1,
devpriv->s_BoardInfos.ui_Address + 44 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
519 if (((
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.b_InterruptMask >> b_TimerNbr) & 1) == 1) {
524 outl(
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].dw_ConfigurationWord,
devpriv->s_BoardInfos.ui_Address + 32 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
531 outl(0,
devpriv->s_BoardInfos.ui_Address + 44 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
536 DPRINTK (
"Timer not initialised see function\n");
541 DPRINTK(
"Timer selection wrong\n");
546 DPRINTK(
"The module is not a TIMER module\n");
551 DPRINTK(
"Module number error\n");
596 int i_ReturnValue = 0;
598 unsigned int *pul_TimerValueArray;
602 pul_TimerValueArray = (
unsigned int *) data;
603 i_ReturnValue = insn->
n;
605 switch (b_ReadType) {
608 data[0] =
devpriv->s_InterruptParameters.s_FIFOInterruptParameters[
devpriv->s_InterruptParameters.ui_Read].b_OldModuleMask;
609 data[1] =
devpriv->s_InterruptParameters.s_FIFOInterruptParameters[
devpriv->s_InterruptParameters.ui_Read].ul_OldInterruptMask;
610 data[2] =
devpriv->s_InterruptParameters.s_FIFOInterruptParameters[
devpriv->s_InterruptParameters.ui_Read].ul_OldCounterLatchValue;
619 if (b_ModulNbr < 4) {
623 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[0].b_82X54Init == 1) {
625 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[1].b_82X54Init == 1) {
627 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[2].b_82X54Init == 1) {
629 outl(0x17,
devpriv->s_BoardInfos.ui_Address + 12 + (64 * b_ModulNbr));
632 pul_TimerValueArray[0] =
inl(
devpriv->s_BoardInfos.ui_Address + 0 + (64 * b_ModulNbr));
635 pul_TimerValueArray[1] =
inl(
devpriv->s_BoardInfos.ui_Address + 4 + (64 * b_ModulNbr));
638 pul_TimerValueArray[2] =
inl(
devpriv->s_BoardInfos.ui_Address + 8 + (64 * b_ModulNbr));
641 DPRINTK(
"Timer 2 not initialised see function\n");
646 DPRINTK(
"Timer 1 not initialised see function\n");
651 DPRINTK(
"Timer 0 not initialised see function\n");
656 DPRINTK(
"The module is not a TIMER module\n");
661 DPRINTK(
"Module number error\n");
687 unsigned char b_BitsType;
688 int i_ReturnValue = 0;
689 b_BitsType = data[0];
693 switch (b_BitsType) {
698 (
unsigned int *) &data[0]);
705 (
unsigned char *) &data[0]);
712 (
unsigned char *)&data[0]);
719 (
unsigned int)data[1]);
724 printk(
"Bits Config Parameter Wrong\n");
728 if (i_ReturnValue >= 0)
729 i_ReturnValue = insn->
n;
764 unsigned char b_ModulNbr,
unsigned char b_TimerNbr,
765 unsigned int *pul_TimerValue)
767 int i_ReturnValue = 0;
770 if (b_ModulNbr < 4) {
773 dw_MolduleConfiguration[b_ModulNbr] &
776 if (b_TimerNbr <= 2) {
779 s_ModuleInfo[b_ModulNbr].
781 s_82X54TimerInfo[b_TimerNbr].
784 outl((2 << b_TimerNbr) | 0xD0,
792 ui_Address + (b_TimerNbr * 4) +
796 DPRINTK(
"Timer not initialised see function\n");
801 DPRINTK(
"Timer selection wrong\n");
806 DPRINTK(
"The module is not a TIMER module\n");
811 DPRINTK(
"Module number error\n");
852 unsigned char b_ModulNbr,
unsigned char b_TimerNbr,
853 unsigned char *pb_OutputLevel)
855 int i_ReturnValue = 0;
856 unsigned int dw_TimerStatus;
859 if (b_ModulNbr < 4) {
863 if (b_TimerNbr <= 2) {
865 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].b_82X54Init == 1) {
867 outl((2 << b_TimerNbr) | 0xE0,
devpriv->s_BoardInfos.ui_Address + 12 + (64 * b_ModulNbr));
870 dw_TimerStatus =
inl(
devpriv->s_BoardInfos.ui_Address + 16 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
872 *pb_OutputLevel = (
unsigned char) (((dw_TimerStatus >> 7) & 1) ^
devpriv-> s_ModuleInfo[
b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[
b_TimerNbr].b_OutputLevel);
875 DPRINTK(
"Timer not initialised see function\n");
880 DPRINTK(
"Timer selection wrong\n");
885 DPRINTK(
"The module is not a TIMER module\n");
890 DPRINTK(
"Module number error\n");
931 unsigned char b_ModulNbr,
unsigned char b_TimerNbr,
932 unsigned char *pb_TimerStatus)
934 int i_ReturnValue = 0;
935 unsigned int dw_TimerStatus;
938 if (b_ModulNbr < 4) {
943 if (b_TimerNbr <= 2) {
945 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].b_82X54Init == 1) {
947 outl((2 << b_TimerNbr) | 0xE0,
devpriv->s_BoardInfos.ui_Address + 12 + (64 * b_ModulNbr));
950 dw_TimerStatus =
inl(
devpriv->s_BoardInfos.ui_Address + 16 + (b_TimerNbr * 4) + (64 * b_ModulNbr));
952 *pb_TimerStatus = (
unsigned char) ((dw_TimerStatus) >> 8) & 1;
953 printk(
"ProgressStatus : %d", *pb_TimerStatus);
1010 unsigned char b_ModulNbr,
unsigned char b_TimerNbr,
1011 unsigned int ul_WriteValue)
1013 int i_ReturnValue = 0;
1016 if (b_ModulNbr < 4) {
1020 if (b_TimerNbr <= 2) {
1022 if (
devpriv->s_ModuleInfo[b_ModulNbr].s_82X54ModuleInfo.s_82X54TimerInfo[b_TimerNbr].b_82X54Init == 1) {
1024 outl(ul_WriteValue,
devpriv->s_BoardInfos.ui_Address + (b_TimerNbr * 4) + (64 * b_ModulNbr));
1027 DPRINTK(
"Timer not initialised see function\n");
1032 DPRINTK(
"Timer selection wrong\n");
1037 DPRINTK(
"The module is not a TIMER module\n");
1042 DPRINTK(
"Module number error\n");