59 static unsigned int ui_InterruptStatus_1564 = 0;
60 static unsigned int ui_InterruptData, ui_Type;
97 data[2] = data[2] << 4;
98 data[3] = data[3] << 4;
153 unsigned int ui_TmpValue = 0;
154 unsigned int ui_Channel;
157 if (ui_Channel <= 31) {
164 *data = (ui_TmpValue >> ui_Channel) & 0x1;
195 unsigned int ui_PortValue = data[0];
196 unsigned int ui_Mask = 0;
197 unsigned int ui_NoOfChannels;
202 switch (ui_NoOfChannels) {
205 *data = (*data >> (2 * ui_PortValue)) & ui_Mask;
209 *data = (*data >> (4 * ui_PortValue)) & ui_Mask;
213 *data = (*data >> (8 * ui_PortValue)) & ui_Mask;
217 *data = (*data >> (16 * ui_PortValue)) & ui_Mask;
229 *data = ui_InterruptStatus_1564;
263 unsigned int ul_Command = 0;
265 if ((data[0] != 0) && (data[0] != 1)) {
267 "Not a valid Data !!! ,Data should be 1 or 0\n");
277 ul_Command = ul_Command | 0x1;
280 ul_Command = ul_Command & 0xFFFFFFFE;
283 ul_Command = ul_Command | 0x2;
286 ul_Command = ul_Command & 0xFFFFFFFD;
320 unsigned int ui_Temp, ui_Temp1;
321 unsigned int ui_NoOfChannel;
324 if (
devpriv->b_OutputMemoryStatus) {
334 data[0] = (data[0] << ui_NoOfChannel) | ui_Temp;
341 switch (ui_NoOfChannel) {
363 data[0] = data[0] | ui_Temp;
375 printk(
"\nSpecified channel not supported\n");
382 data[0] = ~data[0] & 0x1;
384 ui_Temp1 = ui_Temp1 << ui_NoOfChannel;
385 ui_Temp = ui_Temp | ui_Temp1;
387 (data[0] << ui_NoOfChannel) ^
389 data[0] = data[0] & ui_Temp;
397 switch (ui_NoOfChannel) {
399 data[0] = ~data[0] & 0x3;
402 ui_Temp1 << 2 * data[2];
403 ui_Temp = ui_Temp | ui_Temp1;
408 0xffffffff) & ui_Temp;
411 data[0] = ~data[0] & 0xf;
414 ui_Temp1 << 4 * data[2];
415 ui_Temp = ui_Temp | ui_Temp1;
420 0xffffffff) & ui_Temp;
423 data[0] = ~data[0] & 0xff;
426 ui_Temp1 << 8 * data[2];
427 ui_Temp = ui_Temp | ui_Temp1;
432 0xffffffff) & ui_Temp;
435 data[0] = ~data[0] & 0xffff;
440 ui_Temp = ui_Temp | ui_Temp1;
445 0xffffffff) & ui_Temp;
460 printk(
"\nSpecified channel not supported\n");
465 printk(
"\nSpecified functionality does not exist\n");
494 unsigned int ui_Temp;
495 unsigned int ui_NoOfChannel;
502 *data = (*data >> ui_NoOfChannel) & 0x1;
506 switch (ui_NoOfChannel) {
508 *data = (*data >> (2 * data[1])) & 3;
512 *data = (*data >> (4 * data[1])) & 15;
516 *data = (*data >> (8 * data[1])) & 255;
520 *data = (*data >> (16 * data[1])) & 65535;
533 printk(
"\nSpecified channel not supported \n");
572 unsigned int ul_Command1 = 0;
591 ul_Command1 = ul_Command1 & 0xFFFFF9FE
UL;
639 (ul_Command1 & 0xFFF719E2
UL) | 2UL << 13UL | 0x10UL;
644 devpriv->b_ModeSelectRegister = data[5];
648 inl(
devpriv->iobase + ((data[5] - 1) * 0x20) +
650 ul_Command1 = ul_Command1 & 0xFFFFF9FE
UL;
657 devpriv->iobase + ((data[5] - 1) * 0x20) +
670 (ul_Command1 & 0xFFFC19E2
UL) | 0x80000UL |
671 (
unsigned int) ((
unsigned int) data[4] << 16UL);
673 devpriv->iobase + ((data[5] - 1) * 0x20) +
677 ul_Command1 = (ul_Command1 & 0xFFFFF9FD) | (data[1] << 1);
679 devpriv->iobase + ((data[5] - 1) * 0x20) +
685 ul_Command1 = (ul_Command1 & 0xFFFBF9FF
UL) | (data[6] << 18);
687 devpriv->iobase + ((data[5] - 1) * 0x20) +
691 printk(
" Invalid subdevice.");
726 unsigned int ul_Command1 = 0;
745 printk(
"\nSpecified functionality does not exist\n");
754 ul_Command1 = (ul_Command1 & 0xFFFFF9FF
UL) | 0x1UL;
761 else if (data[1] == 0) {
767 ul_Command1 = ul_Command1 & 0xFFFFF9FE
UL;
779 ul_Command1 = (ul_Command1 & 0xFFFFF9FF
UL) | 0x1UL;
781 else if (data[1] == 0) {
786 else if (data[1] == 2) {
788 ul_Command1 = (ul_Command1 & 0xFFFFF9FF
UL) | 0x400;
821 unsigned int ul_Command1 = 0;
855 data[1] = (
unsigned char) ((ul_Command1 >> 1) & 1);
860 data[2] = (
unsigned char) ((ul_Command1 >> 2) & 1);
865 data[3] = (
unsigned char) ((ul_Command1 >> 3) & 1);
870 data[4] = (
unsigned char) ((ul_Command1 >> 0) & 1);
875 printk(
"\n Invalid Subdevice !!!\n");
921 static void v_APCI1564_Interrupt(
int irq,
void *
d)
924 unsigned int ui_DO, ui_DI;
925 unsigned int ui_Timer;
926 unsigned int ui_C1, ui_C2, ui_C3, ui_C4;
927 unsigned int ul_Command2 = 0;
943 if (ui_DI == 0 && ui_DO == 0 && ui_Timer == 0 && ui_C1 == 0
944 && ui_C2 == 0 && ui_C3 == 0 && ui_C4 == 0) {
945 printk(
"\nInterrupt from unknown source\n");
954 ui_InterruptStatus_1564 =
957 ui_InterruptStatus_1564 = ui_InterruptStatus_1564 & 0X000FFFF0;
980 if (
devpriv->b_TimerSelectMode) {
1004 if (
devpriv->b_TimerSelectMode) {
1026 if (
devpriv->b_TimerSelectMode) {
1048 if (
devpriv->b_TimerSelectMode) {
1070 if (
devpriv->b_TimerSelectMode) {
1113 devpriv->b_DigitalOutputRegister = 0;