2 ** -----------------------------------------------------------------------------
4 ** Perle Specialix driver for Linux
5 ** Ported from existing RIO Driver for SCO sources.
7 * (C) 1990 - 2000 Specialix International Ltd., Byfleet, Surrey, UK.
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23 ** Module : rioparam.c
25 ** Last Modified : 11/6/98 10:33:45
26 ** Retrieved : 11/6/98 10:33:50
28 ** ident @(#)rioparam.c 1.3
30 ** -----------------------------------------------------------------------------
34 static char *_rioparam_c_sccs_ = "@(#)rioparam.c 1.3";
37 #include <linux/module.h>
38 #include <linux/slab.h>
39 #include <linux/errno.h>
40 #include <linux/tty.h>
42 #include <asm/system.h>
43 #include <asm/string.h>
44 #include <asm/semaphore.h>
45 #include <asm/uaccess.h>
47 #include <linux/termios.h>
48 #include <linux/serial.h>
50 #include <linux/generic_serial.h>
53 #include "linux_compat.h"
54 #include "rio_linux.h"
91 ** The Scam, based on email from jeremyr@bugs.specialix.co.uk....
93 ** To send a command on a particular port, you put a packet with the
94 ** command bit set onto the port. The command bit is in the len field,
95 ** and gets ORed in with the actual byte count.
97 ** When you send a packet with the command bit set, then the first
98 ** data byte ( data[0] ) is interpretted as the command to execute.
99 ** It also governs what data structure overlay should accompany the packet.
100 ** Commands are defined in cirrus/cirrus.h
102 ** If you want the command to pre-emt data already on the queue for the
103 ** port, set the pre-emptive bit in conjunction with the command bit.
104 ** It is not defined what will happen if you set the preemptive bit
105 ** on a packet that is NOT a command.
107 ** Pre-emptive commands should be queued at the head of the queue using
108 ** add_start(), whereas normal commands and data are enqueued using
111 ** Most commands do not use the remaining bytes in the data array. The
112 ** exceptions are OPEN MOPEN and CONFIG. (NB. As with the SI CONFIG and
113 ** OPEN are currently analagous). With these three commands the following
114 ** 11 data bytes are all used to pass config information such as baud rate etc.
115 ** The fields are also defined in cirrus.h. Some contain straightforward
116 ** information such as the transmit XON character. Two contain the transmit and
117 ** receive baud rates respectively. For most baud rates there is a direct
118 ** mapping between the rates defined in <sys/termio.h> and the byte in the
119 ** packet. There are additional (non UNIX-standard) rates defined in
120 ** /u/dos/rio/cirrus/h/brates.h.
122 ** The rest of the data fields contain approximations to the Cirrus registers
123 ** that are used to program number of bits etc. Each registers bit fields is
124 ** defined in cirrus.h.
126 ** NB. Only use those bits that are defined as being driver specific
127 ** or common to the RTA and the driver.
129 ** All commands going from RTA->Host will be dealt with by the Host code - you
130 ** will never see them. As with the SI there will be three fields to look out
131 ** for in each phb (not yet defined - needs defining a.s.a.p).
133 ** modem_status - current state of handshake pins.
135 ** port_status - current port status - equivalent to hi_stat for SI, indicates
136 ** if port is IDLE_OPEN, IDLE_CLOSED etc.
138 ** break_status - bit X set if break has been received.
145 ** RIOParam is used to open or configure a port. You pass it a PortP,
146 ** which will have a tty struct attached to it. You also pass a command,
147 ** either OPEN or CONFIG. The port's setup is taken from the t_ fields
148 ** of the tty struct inside the PortP, and the port is either opened
149 ** or re-configured. You must also tell RIOParam if the device is a modem
150 ** device or not (i.e. top bit of minor number set or clear - take special
151 ** care when deciding on this!).
152 ** RIOParam neither flushes nor waits for drain, and is NOT preemptive.
154 ** RIOParam assumes it will be called at splrio(), and also assumes
155 ** that CookMode is set correctly in the port structure.
158 ** tty lock must NOT have been previously acquired.
161 RIOParam(PortP, cmd, Modem, SleepFlag)
167 register struct tty_struct *TtyP;
169 register struct phb_param *phb_param_ptr;
172 uchar Cor1=0, Cor2=0, Cor4=0, Cor5=0;
173 uchar TxXon=0, TxXoff=0, RxXon=0, RxXoff=0;
174 uchar LNext=0, TxBaud=0, RxBaud=0;
180 TtyP = PortP->gs.tty;
182 rio_dprintk (RIO_DEBUG_PARAM, "RIOParam: Port:%d cmd:%d Modem:%d SleepFlag:%d Mapped: %d, tty=%p\n",
183 PortP->PortNum, cmd, Modem, SleepFlag, PortP->Mapped, TtyP);
186 rio_dprintk (RIO_DEBUG_PARAM, "Can't call rioparam with null tty.\n");
192 rio_spin_lock_irqsave(&PortP->portSem, flags );
196 ** If the port is set to store or lock the parameters, and it is
197 ** paramed with OPEN, we want to restore the saved port termio, but
198 ** only if StoredTermio has been saved, i.e. NOT 1st open after reboot.
201 if (PortP->FirstOpen) {
202 PortP->StoredTty.iflag = TtyP->tm.c_iflag;
203 PortP->StoredTty.oflag = TtyP->tm.c_oflag;
204 PortP->StoredTty.cflag = TtyP->tm.c_cflag;
205 PortP->StoredTty.lflag = TtyP->tm.c_lflag;
206 PortP->StoredTty.line = TtyP->tm.c_line;
207 for (i = 0; i < NCC + 5; i++)
208 PortP->StoredTty.cc[i] = TtyP->tm.c_cc[i];
209 PortP->FirstOpen = 0;
211 else if (PortP->Store || PortP->Lock) {
212 rio_dprintk (RIO_DEBUG_PARAM, "OPEN: Restoring stored/locked params\n");
213 TtyP->tm.c_iflag = PortP->StoredTty.iflag;
214 TtyP->tm.c_oflag = PortP->StoredTty.oflag;
215 TtyP->tm.c_cflag = PortP->StoredTty.cflag;
216 TtyP->tm.c_lflag = PortP->StoredTty.lflag;
217 TtyP->tm.c_line = PortP->StoredTty.line;
218 for (i = 0; i < NCC + 5; i++)
219 TtyP->tm.c_cc[i] = PortP->StoredTty.cc[i];
227 while ( !(res=can_add_transmit(&PacketP,PortP)) ||
228 (PortP->InUse != NOT_INUSE) ) {
229 if (retries -- <= 0) {
232 if ( PortP->InUse != NOT_INUSE ) {
233 rio_dprintk (RIO_DEBUG_PARAM, "Port IN_USE for pre-emptive command\n");
237 rio_dprintk (RIO_DEBUG_PARAM, "Port has no space on transmit queue\n");
240 if ( SleepFlag != OK_TO_SLEEP ) {
241 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
247 rio_dprintk (RIO_DEBUG_PARAM, "wait for can_add_transmit\n");
248 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
249 retval = RIODelay(PortP, HUNDRED_MS);
250 rio_spin_lock_irqsave( &PortP->portSem, flags);
251 if (retval == RIO_FAIL) {
252 rio_dprintk (RIO_DEBUG_PARAM, "wait for can_add_transmit broken by signal\n");
253 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
259 if ( PortP->State & RIO_DELETED ) {
260 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
268 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
274 rio_dprintk (RIO_DEBUG_PARAM, "can_add_transmit() returns %x\n",res);
275 rio_dprintk (RIO_DEBUG_PARAM, "Packet is 0x%x\n",(int) PacketP);
277 phb_param_ptr = (struct phb_param *)PacketP->data;
284 if ( TtyP->tm.c_iflag & INPCK ) {
285 rio_dprintk (RIO_DEBUG_PARAM, "Parity checking on input enabled\n");
290 switch ( TtyP->termios->c_cflag & CSIZE ) {
293 rio_dprintk (RIO_DEBUG_PARAM, "5 bit data\n");
299 rio_dprintk (RIO_DEBUG_PARAM, "6 bit data\n");
305 rio_dprintk (RIO_DEBUG_PARAM, "7 bit data\n");
311 rio_dprintk (RIO_DEBUG_PARAM, "8 bit data\n");
317 if ( TtyP->termios->c_cflag & CSTOPB ) {
318 rio_dprintk (RIO_DEBUG_PARAM, "2 stop bits\n");
322 rio_dprintk (RIO_DEBUG_PARAM, "1 stop bit\n");
326 if ( TtyP->termios->c_cflag & PARENB ) {
327 rio_dprintk (RIO_DEBUG_PARAM, "Enable parity\n");
331 rio_dprintk (RIO_DEBUG_PARAM, "Disable parity\n");
334 if ( TtyP->termios->c_cflag & PARODD ) {
335 rio_dprintk (RIO_DEBUG_PARAM, "Odd parity\n");
339 rio_dprintk (RIO_DEBUG_PARAM, "Even parity\n");
346 if ( TtyP->termios->c_iflag & IXON ) {
347 rio_dprintk (RIO_DEBUG_PARAM, "Enable start/stop output control\n");
351 if ( PortP->Config & RIO_IXON ) {
352 rio_dprintk (RIO_DEBUG_PARAM, "Force enable start/stop output control\n");
356 rio_dprintk (RIO_DEBUG_PARAM, "IXON has been disabled.\n");
359 if (TtyP->termios->c_iflag & IXANY) {
360 if ( PortP->Config & RIO_IXANY ) {
361 rio_dprintk (RIO_DEBUG_PARAM, "Enable any key to restart output\n");
365 rio_dprintk (RIO_DEBUG_PARAM, "IXANY has been disabled due to sanity reasons.\n");
368 if ( TtyP->termios->c_iflag & IXOFF ) {
369 rio_dprintk (RIO_DEBUG_PARAM, "Enable start/stop input control 2\n");
373 if ( TtyP->termios->c_cflag & HUPCL ) {
374 rio_dprintk (RIO_DEBUG_PARAM, "Hangup on last close\n");
378 if ( C_CRTSCTS (TtyP)) {
379 rio_dprintk (RIO_DEBUG_PARAM, "Rx hardware flow control enabled\n");
380 Cor2 |= COR2_CTSFLOW;
381 Cor2 |= COR2_RTSFLOW;
383 rio_dprintk (RIO_DEBUG_PARAM, "Rx hardware flow control disabled\n");
384 Cor2 &= ~COR2_CTSFLOW;
385 Cor2 &= ~COR2_RTSFLOW;
389 if ( TtyP->termios->c_cflag & CLOCAL ) {
390 rio_dprintk (RIO_DEBUG_PARAM, "Local line\n");
393 rio_dprintk (RIO_DEBUG_PARAM, "Possible Modem line\n");
397 ** COR 4 (there is no COR 3)
399 if ( TtyP->termios->c_iflag & IGNBRK ) {
400 rio_dprintk (RIO_DEBUG_PARAM, "Ignore break condition\n");
403 if ( !(TtyP->termios->c_iflag & BRKINT) ) {
404 rio_dprintk (RIO_DEBUG_PARAM, "Break generates NULL condition\n");
405 Cor4 |= COR4_NBRKINT;
407 rio_dprintk (RIO_DEBUG_PARAM, "Interrupt on break condition\n");
410 if ( TtyP->termios->c_iflag & INLCR ) {
411 rio_dprintk (RIO_DEBUG_PARAM, "Map newline to carriage return on input\n");
415 if ( TtyP->termios->c_iflag & IGNCR ) {
416 rio_dprintk (RIO_DEBUG_PARAM, "Ignore carriage return on input\n");
420 if ( TtyP->termios->c_iflag & ICRNL ) {
421 rio_dprintk (RIO_DEBUG_PARAM, "Map carriage return to newline on input\n");
424 if ( TtyP->termios->c_iflag & IGNPAR ) {
425 rio_dprintk (RIO_DEBUG_PARAM, "Ignore characters with parity errors\n");
428 if ( TtyP->termios->c_iflag & PARMRK ) {
429 rio_dprintk (RIO_DEBUG_PARAM, "Mark parity errors\n");
434 ** Set the RAISEMOD flag to ensure that the modem lines are raised
435 ** on reception of a config packet.
436 ** The download code handles the zero baud condition.
438 Cor4 |= COR4_RAISEMOD;
447 ** Set to monitor tbusy/tstop (or not).
450 if (PortP->MonitorTstate)
451 Cor5 |= COR5_TSTATE_ON;
453 Cor5 |= COR5_TSTATE_OFF;
456 ** Could set LNE here if you wanted LNext processing. SVR4 will use it.
458 if ( TtyP->termios->c_iflag & ISTRIP ) {
459 rio_dprintk (RIO_DEBUG_PARAM, "Strip input characters\n");
460 if (! (PortP->State & RIO_TRIAD_MODE)) {
465 if ( TtyP->termios->c_oflag & ONLCR ) {
466 rio_dprintk (RIO_DEBUG_PARAM, "Map newline to carriage-return, newline on output\n");
467 if ( PortP->CookMode == COOK_MEDIUM )
470 if ( TtyP->termios->c_oflag & OCRNL ) {
471 rio_dprintk (RIO_DEBUG_PARAM, "Map carriage return to newline on output\n");
472 if ( PortP->CookMode == COOK_MEDIUM )
475 if ( ( TtyP->termios->c_oflag & TABDLY) == TAB3 ) {
476 rio_dprintk (RIO_DEBUG_PARAM, "Tab delay 3 set\n");
477 if ( PortP->CookMode == COOK_MEDIUM )
482 ** Flow control bytes.
484 TxXon = TtyP->termios->c_cc[VSTART];
485 TxXoff = TtyP->termios->c_cc[VSTOP];
486 RxXon = TtyP->termios->c_cc[VSTART];
487 RxXoff = TtyP->termios->c_cc[VSTOP];
496 rio_dprintk (RIO_DEBUG_PARAM, "Mapping of rx/tx baud %x (%x)\n",
497 TtyP->termios->c_cflag, CBAUD);
499 switch (TtyP->termios->c_cflag & CBAUD) {
500 #define e(b) case B ## b : RxBaud = TxBaud = RIO_B ## b ;break
501 e(50);e(75);e(110);e(134);e(150);e(200);e(300);e(600);e(1200);
502 e(1800);e(2400);e(4800);e(9600);e(19200);e(38400);e(57600);
503 e(115200); /* e(230400);e(460800); e(921600); */
506 /* XXX MIssing conversion table. XXX */
507 /* (TtyP->termios->c_cflag & V_CBAUD); */
509 rio_dprintk (RIO_DEBUG_PARAM, "tx baud 0x%x, rx baud 0x%x\n", TxBaud, RxBaud);
515 if ( TtyP->termios->c_cflag & CREAD )
516 rio_dprintk (RIO_DEBUG_PARAM, "Enable receiver\n");
518 if ( TtyP->termios->c_cflag & RCV1EN )
519 rio_dprintk (RIO_DEBUG_PARAM, "RCV1EN (?)\n");
522 if ( TtyP->termios->c_cflag & XMT1EN )
523 rio_dprintk (RIO_DEBUG_PARAM, "XMT1EN (?)\n");
526 if ( TtyP->termios->c_cflag & LOBLK )
527 rio_dprintk (RIO_DEBUG_PARAM, "LOBLK - JCL output blocks when not current\n");
529 if ( TtyP->termios->c_lflag & ISIG )
530 rio_dprintk (RIO_DEBUG_PARAM, "Input character signal generating enabled\n");
531 if ( TtyP->termios->c_lflag & ICANON )
532 rio_dprintk (RIO_DEBUG_PARAM, "Canonical input: erase and kill enabled\n");
533 if ( TtyP->termios->c_lflag & XCASE )
534 rio_dprintk (RIO_DEBUG_PARAM, "Canonical upper/lower presentation\n");
535 if ( TtyP->termios->c_lflag & ECHO )
536 rio_dprintk (RIO_DEBUG_PARAM, "Enable input echo\n");
537 if ( TtyP->termios->c_lflag & ECHOE )
538 rio_dprintk (RIO_DEBUG_PARAM, "Enable echo erase\n");
539 if ( TtyP->termios->c_lflag & ECHOK )
540 rio_dprintk (RIO_DEBUG_PARAM, "Enable echo kill\n");
541 if ( TtyP->termios->c_lflag & ECHONL )
542 rio_dprintk (RIO_DEBUG_PARAM, "Enable echo newline\n");
543 if ( TtyP->termios->c_lflag & NOFLSH )
544 rio_dprintk (RIO_DEBUG_PARAM, "Disable flush after interrupt or quit\n");
546 if ( TtyP->termios->c_lflag & TOSTOP )
547 rio_dprintk (RIO_DEBUG_PARAM, "Send SIGTTOU for background output\n");
550 if ( TtyP->termios->c_lflag & XCLUDE )
551 rio_dprintk (RIO_DEBUG_PARAM, "Exclusive use of this line\n");
553 if ( TtyP->termios->c_iflag & IUCLC )
554 rio_dprintk (RIO_DEBUG_PARAM, "Map uppercase to lowercase on input\n");
555 if ( TtyP->termios->c_oflag & OPOST )
556 rio_dprintk (RIO_DEBUG_PARAM, "Enable output post-processing\n");
557 if ( TtyP->termios->c_oflag & OLCUC )
558 rio_dprintk (RIO_DEBUG_PARAM, "Map lowercase to uppercase on output\n");
559 if ( TtyP->termios->c_oflag & ONOCR )
560 rio_dprintk (RIO_DEBUG_PARAM, "No carriage return output at column 0\n");
561 if ( TtyP->termios->c_oflag & ONLRET )
562 rio_dprintk (RIO_DEBUG_PARAM, "Newline performs carriage return function\n");
563 if ( TtyP->termios->c_oflag & OFILL )
564 rio_dprintk (RIO_DEBUG_PARAM, "Use fill characters for delay\n");
565 if ( TtyP->termios->c_oflag & OFDEL )
566 rio_dprintk (RIO_DEBUG_PARAM, "Fill character is DEL\n");
567 if ( TtyP->termios->c_oflag & NLDLY )
568 rio_dprintk (RIO_DEBUG_PARAM, "Newline delay set\n");
569 if ( TtyP->termios->c_oflag & CRDLY )
570 rio_dprintk (RIO_DEBUG_PARAM, "Carriage return delay set\n");
571 if ( TtyP->termios->c_oflag & TABDLY )
572 rio_dprintk (RIO_DEBUG_PARAM, "Tab delay set\n");
574 if ( TtyP->termios->c_oflag & BSDLY )
575 rio_dprintk (RIO_DEBUG_PARAM, "Back-space delay set\n");
576 if ( TtyP->termios->c_oflag & VTDLY )
577 rio_dprintk (RIO_DEBUG_PARAM, "Vertical tab delay set\n");
578 if ( TtyP->termios->c_oflag & FFDLY )
579 rio_dprintk (RIO_DEBUG_PARAM, "Form-feed delay set\n");
582 ** These things are kind of useful in a later life!
584 PortP->Cor2Copy = Cor2;
586 if ( PortP->State & RIO_DELETED ) {
587 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
594 ** Actually write the info into the packet to be sent
596 WBYTE(phb_param_ptr->Cmd, cmd);
597 WBYTE(phb_param_ptr->Cor1, Cor1);
598 WBYTE(phb_param_ptr->Cor2, Cor2);
599 WBYTE(phb_param_ptr->Cor4, Cor4);
600 WBYTE(phb_param_ptr->Cor5, Cor5);
601 WBYTE(phb_param_ptr->TxXon, TxXon);
602 WBYTE(phb_param_ptr->RxXon, RxXon);
603 WBYTE(phb_param_ptr->TxXoff, TxXoff);
604 WBYTE(phb_param_ptr->RxXoff, RxXoff);
605 WBYTE(phb_param_ptr->LNext, LNext);
606 WBYTE(phb_param_ptr->TxBaud, TxBaud);
607 WBYTE(phb_param_ptr->RxBaud, RxBaud);
610 ** Set the length/command field
612 WBYTE(PacketP->len , 12 | PKT_CMD_BIT);
615 ** The packet is formed - now, whack it off
616 ** to its final destination:
620 ** Count characters transmitted for port statistics reporting
622 if (PortP->statsGather)
623 PortP->txchars += 12;
625 rio_spin_unlock_irqrestore( &PortP->portSem, flags);
627 rio_dprintk (RIO_DEBUG_PARAM, "add_transmit returned.\n");
638 ** We can add another packet to a transmit queue if the packet pointer pointed
639 ** to by the TxAdd pointer has PKT_IN_USE clear in its address.
642 can_add_transmit(PktP, PortP)
648 *PktP = tp = (PKT *)RIO_PTR(PortP->Caddr,RWORD(*PortP->TxAdd));
650 return !((uint)tp & PKT_IN_USE);
654 ** To add a packet to the queue, you set the PKT_IN_USE bit in the address,
655 ** and then move the TxAdd pointer along one position to point to the next
656 ** packet pointer. You must wrap the pointer from the end back to the start.
662 if (RWORD(*PortP->TxAdd) & PKT_IN_USE) {
663 rio_dprintk (RIO_DEBUG_PARAM, "add_transmit: Packet has been stolen!");
665 WWORD( *(ushort *)PortP->TxAdd, RWORD(*PortP->TxAdd) | PKT_IN_USE);
666 PortP->TxAdd = (PortP->TxAdd == PortP->TxEnd) ? PortP->TxStart :
668 WWORD( PortP->PhbP->tx_add , RIO_OFF(PortP->Caddr,PortP->TxAdd) );
671 /****************************************
672 * Put a packet onto the end of the
674 ****************************************/
676 put_free_end(HostP, PktP)
680 FREE_LIST *tmp_pointer;
681 ushort old_end, new_end;
684 rio_spin_lock_irqsave(&HostP->HostLock, flags);
686 /*************************************************
687 * Put a packet back onto the back of the free list
689 ************************************************/
691 rio_dprintk (RIO_DEBUG_PFE, "put_free_end(PktP=%x)\n",(int)PktP);
693 if ((old_end=RWORD(HostP->ParmMapP->free_list_end)) != TPNULL) {
694 new_end = RIO_OFF(HostP->Caddr,PktP);
695 tmp_pointer = (FREE_LIST *)RIO_PTR(HostP->Caddr,old_end);
696 WWORD(tmp_pointer->next , new_end );
697 WWORD(((FREE_LIST *)PktP)->prev , old_end);
698 WWORD(((FREE_LIST *)PktP)->next , TPNULL);
699 WWORD(HostP->ParmMapP->free_list_end, new_end);
701 else { /* First packet on the free list this should never happen! */
702 rio_dprintk (RIO_DEBUG_PFE, "put_free_end(): This should never happen\n");
703 WWORD(HostP->ParmMapP->free_list_end , RIO_OFF(HostP->Caddr,PktP));
704 tmp_pointer = (FREE_LIST *)PktP;
705 WWORD(tmp_pointer->prev , TPNULL);
706 WWORD(tmp_pointer->next , TPNULL);
708 rio_dprintk (RIO_DEBUG_CMD, "Before unlock: %p\n", &HostP->HostLock);
709 rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
713 ** can_remove_receive(PktP,P) returns non-zero if PKT_IN_USE is set
714 ** for the next packet on the queue. It will also set PktP to point to the
715 ** relevant packet, [having cleared the PKT_IN_USE bit]. If PKT_IN_USE is clear,
716 ** then can_remove_receive() returns 0.
719 can_remove_receive(PktP, PortP)
723 if ( RWORD(*PortP->RxRemove) & PKT_IN_USE) {
724 *PktP = (PKT *)RIO_PTR(PortP->Caddr,
725 RWORD(*PortP->RxRemove) & ~PKT_IN_USE);
732 ** To remove a packet from the receive queue you clear its PKT_IN_USE bit,
733 ** and then bump the pointers. Once the pointers get to the end, they must
734 ** be wrapped back to the start.
737 remove_receive(PortP)
740 WWORD( *PortP->RxRemove, RWORD(*PortP->RxRemove) & ~PKT_IN_USE );
741 PortP->RxRemove = (PortP->RxRemove == PortP->RxEnd) ? PortP->RxStart :
743 WWORD( PortP->PhbP->rx_remove , RIO_OFF(PortP->Caddr, PortP->RxRemove) );