97 unsigned char b_Command = 0;
98 unsigned char b_Cpt = 0;
99 unsigned char b_NumberOfPort =
111 b_Command = (
unsigned char) data[0];
125 && ((
unsigned char) (insn->
n - 1) != b_NumberOfPort)) {
130 printk(
"\nBuffer size error");
131 i_ReturnValue = -101;
135 && ((
unsigned char) (insn->
n) != 2)) {
140 printk(
"\nBuffer size error");
141 i_ReturnValue = -101;
148 printk(
"\nCommand selection error");
149 i_ReturnValue = -100;
156 printk(
"\nBuffer size error");
157 i_ReturnValue = -101;
166 sizeof(
devpriv->ul_TTLPortConfiguration));
173 (b_Cpt <= b_NumberOfPort) && (i_ReturnValue >= 0);
179 if ((data[b_Cpt] != 0) && (data[b_Cpt] != 0xFF)) {
184 printk(
"\nPort %d direction selection error",
186 i_ReturnValue = -(
int) b_Cpt;
193 devpriv->ul_TTLPortConfiguration[(b_Cpt - 1) / 4] =
194 devpriv->ul_TTLPortConfiguration[(b_Cpt -
195 1) / 4] | (data[b_Cpt] << (8 * ((b_Cpt -
204 if (i_ReturnValue >= 0) {
215 for (b_Cpt = 0; b_Cpt <= b_NumberOfPort; b_Cpt++) {
216 if ((b_Cpt % 4) == 0) {
222 ul_TTLPortConfiguration[b_Cpt /
290 unsigned char b_Command = 0;
291 unsigned char b_NumberOfPort =
295 unsigned char *pb_Status;
296 unsigned int dw_Status;
307 b_Command = (
unsigned char) data[0];
319 if (b_SelectedPort < b_NumberOfPort) {
324 if (((
devpriv->ul_TTLPortConfiguration
337 && (b_InputChannel > 7)) {
342 printk(
"\nChannel selection error");
343 i_ReturnValue = -103;
350 printk(
"\nPort selection error");
351 i_ReturnValue = -102;
358 printk(
"\nPort selection error");
359 i_ReturnValue = -102;
366 printk(
"\nCommand selection error");
367 i_ReturnValue = -100;
374 printk(
"\nBuffer size error");
375 i_ReturnValue = -101;
382 if (i_ReturnValue >= 0) {
383 pb_Status = (
unsigned char *) &data[0];
390 inl(
devpriv->iobase + 8 + ((b_SelectedPort / 4) * 4));
391 dw_Status = (dw_Status >> (8 * (b_SelectedPort % 4))) & 0xFF;
397 *pb_Status = (
unsigned char) dw_Status;
404 *pb_Status = (*pb_Status >> b_InputChannel) & 1;
438 unsigned char b_Cpt = 0;
439 unsigned char b_NumberOfPort = 0;
440 unsigned int *pls_ReadData =
data;
454 if ((b_NumberOfPort * 32) <
456 b_NumberOfPort = b_NumberOfPort + 1;
463 if (insn->
n >= b_NumberOfPort) {
469 for (b_Cpt = 0; b_Cpt < b_NumberOfPort; b_Cpt++) {
474 pls_ReadData[b_Cpt] =
482 pls_ReadData[b_Cpt] =
483 pls_ReadData[b_Cpt] &
485 ul_TTLPortConfiguration[b_Cpt]);
492 for (b_Cpt = 0; b_Cpt < b_NumberOfPort; b_Cpt++) {
497 pls_ReadData[b_Cpt] =
505 pls_ReadData[b_Cpt] =
506 pls_ReadData[b_Cpt] &
devpriv->
507 ul_TTLPortConfiguration[b_Cpt];
515 printk(
"\nBuffer size error");
516 i_ReturnValue = -101;
523 printk(
"\nCommand selection error");
524 i_ReturnValue = -100;
577 unsigned char b_Command = 0;
578 unsigned char b_NumberOfPort =
582 unsigned int dw_Status = 0;
593 b_Command = (
unsigned char) data[0];
607 if (b_SelectedPort < b_NumberOfPort) {
612 if (((
devpriv->ul_TTLPortConfiguration
628 printk(
"\nChannel selection error");
629 i_ReturnValue = -103;
637 printk(
"\nOutput memory disabled");
638 i_ReturnValue = -104;
650 printk(
"\nBuffer size error");
651 i_ReturnValue = -101;
658 printk(
"\nPort selection error %lX",
660 ul_TTLPortConfiguration[0]);
661 i_ReturnValue = -102;
668 printk(
"\nPort selection error %d %d",
669 b_SelectedPort, b_NumberOfPort);
670 i_ReturnValue = -102;
677 printk(
"\nCommand selection error");
678 i_ReturnValue = -100;
685 printk(
"\nBuffer size error");
686 i_ReturnValue = -101;
693 if (i_ReturnValue >= 0) {
699 inl(
devpriv->iobase + 20 + ((b_SelectedPort / 4) * 4));
711 dw_Status & (0xFFFFFFFF
UL -
712 (0xFF
UL << (8 * (b_SelectedPort % 4))));
721 dw_Status | (1
UL << ((8 * (b_SelectedPort %
731 dw_Status | ((data[1] & 0xFF) << (8 *
732 (b_SelectedPort % 4)));
741 dw_Status & (0xFFFFFFFF
UL -
742 (1
UL << ((8 * (b_SelectedPort % 4)) +
752 dw_Status & (0xFFFFFFFF
UL -
753 ((data[1] & 0xFF) << (8 * (b_SelectedPort %
758 devpriv->iobase + 20 + ((b_SelectedPort / 4) * 4));