aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/rioctrl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/rio/rioctrl.c')
-rw-r--r--drivers/char/rio/rioctrl.c111
1 files changed, 1 insertions, 110 deletions
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index 0b7700d2f049..fcf18a061228 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -308,12 +308,7 @@ int su;
308 } 308 }
309 309
310 case RIO_DEBUG_MEM: 310 case RIO_DEBUG_MEM:
311#ifdef DEBUG_MEM_SUPPORT 311 return -EPERM;
312 RIO_DEBUG_CTRL, if (su)
313 return rio_RIODebugMemory(RIO_DEBUG_CTRL, arg);
314 else
315#endif
316 return -EPERM;
317 312
318 case RIO_ALL_MODEM: 313 case RIO_ALL_MODEM:
319 rio_dprintk(RIO_DEBUG_CTRL, "RIO_ALL_MODEM\n"); 314 rio_dprintk(RIO_DEBUG_CTRL, "RIO_ALL_MODEM\n");
@@ -591,12 +586,7 @@ int su;
591 586
592 case RIO_GET_LOG: 587 case RIO_GET_LOG:
593 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_LOG\n"); 588 rio_dprintk(RIO_DEBUG_CTRL, "RIO_GET_LOG\n");
594#ifdef LOGGING
595 RIOGetLog(arg);
596 return 0;
597#else
598 return -EINVAL; 589 return -EINVAL;
599#endif
600 590
601 case RIO_GET_MODTYPE: 591 case RIO_GET_MODTYPE:
602 if (copyin((int) arg, (caddr_t) & port, sizeof(uint)) == COPYFAIL) { 592 if (copyin((int) arg, (caddr_t) & port, sizeof(uint)) == COPYFAIL) {
@@ -684,52 +674,6 @@ int su;
684 rio_dprintk(RIO_DEBUG_CTRL, "entering loop (%d %d)!\n", PortSetup.From, PortSetup.To); 674 rio_dprintk(RIO_DEBUG_CTRL, "entering loop (%d %d)!\n", PortSetup.From, PortSetup.To);
685 for (loop = PortSetup.From; loop <= PortSetup.To; loop++) { 675 for (loop = PortSetup.From; loop <= PortSetup.To; loop++) {
686 rio_dprintk(RIO_DEBUG_CTRL, "in loop (%d)!\n", loop); 676 rio_dprintk(RIO_DEBUG_CTRL, "in loop (%d)!\n", loop);
687#if 0
688 PortP = p->RIOPortp[loop];
689 if (!PortP->TtyP)
690 PortP->TtyP = &p->channel[loop];
691
692 rio_spin_lock_irqsave(&PortP->portSem, flags);
693 if (PortSetup.IxAny)
694 PortP->Config |= RIO_IXANY;
695 else
696 PortP->Config &= ~RIO_IXANY;
697 if (PortSetup.IxOn)
698 PortP->Config |= RIO_IXON;
699 else
700 PortP->Config &= ~RIO_IXON;
701
702 /*
703 ** If the port needs to wait for all a processes output
704 ** to drain before closing then this flag will be set.
705 */
706 if (PortSetup.Drain) {
707 PortP->Config |= RIO_WAITDRAIN;
708 } else {
709 PortP->Config &= ~RIO_WAITDRAIN;
710 }
711 /*
712 ** Store settings if locking or unlocking port or if the
713 ** port is not locked, when setting the store option.
714 */
715 if (PortP->Mapped && ((PortSetup.Lock && !PortP->Lock) || (!PortP->Lock && (PortSetup.Store && !PortP->Store)))) {
716 PortP->StoredTty.iflag = PortP->TtyP->tm.c_iflag;
717 PortP->StoredTty.oflag = PortP->TtyP->tm.c_oflag;
718 PortP->StoredTty.cflag = PortP->TtyP->tm.c_cflag;
719 PortP->StoredTty.lflag = PortP->TtyP->tm.c_lflag;
720 PortP->StoredTty.line = PortP->TtyP->tm.c_line;
721 bcopy(PortP->TtyP->tm.c_cc, PortP->StoredTty.cc, NCC + 5);
722 }
723 PortP->Lock = PortSetup.Lock;
724 PortP->Store = PortSetup.Store;
725 PortP->Xprint.XpCps = PortSetup.XpCps;
726 bcopy(PortSetup.XpOn, PortP->Xprint.XpOn, MAX_XP_CTRL_LEN);
727 bcopy(PortSetup.XpOff, PortP->Xprint.XpOff, MAX_XP_CTRL_LEN);
728 PortP->Xprint.XpOn[MAX_XP_CTRL_LEN - 1] = '\0';
729 PortP->Xprint.XpOff[MAX_XP_CTRL_LEN - 1] = '\0';
730 PortP->Xprint.XpLen = RIOStrlen(PortP->Xprint.XpOn) + RIOStrlen(PortP->Xprint.XpOff);
731 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
732#endif
733 } 677 }
734 rio_dprintk(RIO_DEBUG_CTRL, "after loop (%d)!\n", loop); 678 rio_dprintk(RIO_DEBUG_CTRL, "after loop (%d)!\n", loop);
735 rio_dprintk(RIO_DEBUG_CTRL, "Retval:%x\n", retval); 679 rio_dprintk(RIO_DEBUG_CTRL, "Retval:%x\n", retval);
@@ -801,12 +745,6 @@ int su;
801 745
802 rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port); 746 rio_dprintk(RIO_DEBUG_CTRL, "Port %d\n", PortTty.port);
803 PortP = (p->RIOPortp[PortTty.port]); 747 PortP = (p->RIOPortp[PortTty.port]);
804#if 0
805 PortTty.Tty.tm.c_iflag = PortP->TtyP->tm.c_iflag;
806 PortTty.Tty.tm.c_oflag = PortP->TtyP->tm.c_oflag;
807 PortTty.Tty.tm.c_cflag = PortP->TtyP->tm.c_cflag;
808 PortTty.Tty.tm.c_lflag = PortP->TtyP->tm.c_lflag;
809#endif
810 if (copyout((caddr_t) & PortTty, (int) arg, sizeof(struct PortTty)) == COPYFAIL) { 748 if (copyout((caddr_t) & PortTty, (int) arg, sizeof(struct PortTty)) == COPYFAIL) {
811 p->RIOError.Error = COPYOUT_FAILED; 749 p->RIOError.Error = COPYOUT_FAILED;
812 return -EFAULT; 750 return -EFAULT;
@@ -824,15 +762,6 @@ int su;
824 return -ENXIO; 762 return -ENXIO;
825 } 763 }
826 PortP = (p->RIOPortp[PortTty.port]); 764 PortP = (p->RIOPortp[PortTty.port]);
827#if 0
828 rio_spin_lock_irqsave(&PortP->portSem, flags);
829 PortP->TtyP->tm.c_iflag = PortTty.Tty.tm.c_iflag;
830 PortP->TtyP->tm.c_oflag = PortTty.Tty.tm.c_oflag;
831 PortP->TtyP->tm.c_cflag = PortTty.Tty.tm.c_cflag;
832 PortP->TtyP->tm.c_lflag = PortTty.Tty.tm.c_lflag;
833 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
834#endif
835
836 RIOParam(PortP, CONFIG, PortP->State & RIO_MODEM, OK_TO_SLEEP); 765 RIOParam(PortP, CONFIG, PortP->State & RIO_MODEM, OK_TO_SLEEP);
837 return retval; 766 return retval;
838 767
@@ -909,23 +838,6 @@ int su;
909 rio_spin_unlock_irqrestore(&PortP->portSem, flags); 838 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
910 return retval; 839 return retval;
911 840
912#ifdef DEBUG_SUPPORTED
913 case RIO_READ_LEVELS:
914 {
915 int num;
916 rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_LEVELS\n");
917 for (num = 0; RIODbInf[num].Flag; num++);
918 rio_dprintk(RIO_DEBUG_CTRL, "%d levels to copy\n", num);
919 if (copyout((caddr_t) RIODbInf, (int) arg, sizeof(struct DbInf) * (num + 1)) == COPYFAIL) {
920 rio_dprintk(RIO_DEBUG_CTRL, "ReadLevels Copy failed\n");
921 p->RIOError.Error = COPYOUT_FAILED;
922 return -EFAULT;
923 }
924 rio_dprintk(RIO_DEBUG_CTRL, "%d levels to copied\n", num);
925 return retval;
926 }
927#endif
928
929 case RIO_READ_CONFIG: 841 case RIO_READ_CONFIG:
930 rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n"); 842 rio_dprintk(RIO_DEBUG_CTRL, "RIO_READ_CONFIG\n");
931 if (copyout((caddr_t) & p->RIOConf, (int) arg, sizeof(struct Conf)) == COPYFAIL) { 843 if (copyout((caddr_t) & p->RIOConf, (int) arg, sizeof(struct Conf)) == COPYFAIL) {
@@ -1084,30 +996,13 @@ int su;
1084 (void) RIOBoardTest(p->RIOHosts[Host].PaddrP, p->RIOHosts[Host].Caddr, p->RIOHosts[Host].Type, p->RIOHosts[Host].Slot); 996 (void) RIOBoardTest(p->RIOHosts[Host].PaddrP, p->RIOHosts[Host].Caddr, p->RIOHosts[Host].Type, p->RIOHosts[Host].Slot);
1085 bzero((caddr_t) & p->RIOHosts[Host].Flags, ((int) &p->RIOHosts[Host].____end_marker____) - ((int) &p->RIOHosts[Host].Flags)); 997 bzero((caddr_t) & p->RIOHosts[Host].Flags, ((int) &p->RIOHosts[Host].____end_marker____) - ((int) &p->RIOHosts[Host].Flags));
1086 p->RIOHosts[Host].Flags = RC_WAITING; 998 p->RIOHosts[Host].Flags = RC_WAITING;
1087#if 0
1088 RIOSetupDataStructs(p);
1089#endif
1090 } 999 }
1091 RIOFoadWakeup(p); 1000 RIOFoadWakeup(p);
1092 p->RIONumBootPkts = 0; 1001 p->RIONumBootPkts = 0;
1093 p->RIOBooting = 0; 1002 p->RIOBooting = 0;
1094
1095#ifdef RINGBUFFER_SUPPORT
1096 for (loop = 0; loop < RIO_PORTS; loop++)
1097 if (p->RIOPortp[loop]->TxRingBuffer)
1098 sysfree((void *) p->RIOPortp[loop]->TxRingBuffer, RIOBufferSize);
1099#endif
1100#if 0
1101 bzero((caddr_t) & p->RIOPortp[0], RIO_PORTS * sizeof(struct Port));
1102#else
1103 printk("HEEEEELP!\n"); 1003 printk("HEEEEELP!\n");
1104#endif
1105 1004
1106 for (loop = 0; loop < RIO_PORTS; loop++) { 1005 for (loop = 0; loop < RIO_PORTS; loop++) {
1107#if 0
1108 p->RIOPortp[loop]->TtyP = &p->channel[loop];
1109#endif
1110
1111 spin_lock_init(&p->RIOPortp[loop]->portSem); 1006 spin_lock_init(&p->RIOPortp[loop]->portSem);
1112 p->RIOPortp[loop]->InUse = NOT_INUSE; 1007 p->RIOPortp[loop]->InUse = NOT_INUSE;
1113 } 1008 }
@@ -1653,10 +1548,6 @@ uchar Cmd;
1653 ushort rup; 1548 ushort rup;
1654 int port; 1549 int port;
1655 1550
1656#ifdef CHECK
1657 CheckPortP(PortP);
1658#endif
1659
1660 if (PortP->State & RIO_DELETED) { 1551 if (PortP->State & RIO_DELETED) {
1661 rio_dprintk(RIO_DEBUG_CTRL, "Preemptive command to deleted RTA ignored\n"); 1552 rio_dprintk(RIO_DEBUG_CTRL, "Preemptive command to deleted RTA ignored\n");
1662 return RIO_FAIL; 1553 return RIO_FAIL;