• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/char/rio/

Lines Matching defs:PortP

95 	struct Port *PortP;
102 PortP = (struct Port *) en;
103 p = (struct rio_info *) PortP->p;
104 tty = PortP->gs.port.tty;
107 rio_dprintk(RIO_DEBUG_INTR, "tx port %d: %d chars queued.\n", PortP->PortNum, PortP->gs.xmit_cnt);
109 if (!PortP->gs.xmit_cnt)
119 rio_spin_lock_irqsave(&PortP->portSem, flags);
121 while (can_add_transmit(&PacketP, PortP)) {
122 c = PortP->gs.xmit_cnt;
127 if (c > SERIAL_XMIT_SIZE - PortP->gs.xmit_tail)
128 c = SERIAL_XMIT_SIZE - PortP->gs.xmit_tail;
134 rio_dprintk(RIO_DEBUG_INTR, "rio: tx port %d: copying %d chars: %s - %s\n", PortP->PortNum, c, firstchars(PortP->gs.xmit_buf + PortP->gs.xmit_tail, t), firstchars(PortP->gs.xmit_buf + PortP->gs.xmit_tail + c - t, t));
141 rio_memcpy_toio(PortP->HostP->Caddr, PacketP->data, PortP->gs.xmit_buf + PortP->gs.xmit_tail, c);
145 if (!(PortP->State & RIO_DELETED)) {
146 add_transmit(PortP);
150 if (PortP->statsGather)
151 PortP->txchars += c;
153 PortP->gs.xmit_tail = (PortP->gs.xmit_tail + c) & (SERIAL_XMIT_SIZE - 1);
154 PortP->gs.xmit_cnt -= c;
157 rio_spin_unlock_irqrestore(&PortP->portSem, flags);
159 if (PortP->gs.xmit_cnt <= (PortP->gs.wakeup_chars + 2 * PKT_MAX_DATA_LEN))
160 tty_wakeup(PortP->gs.port.tty);
209 struct Port *PortP = p->RIOPortp[port];
218 if (!PortP->Mapped) {
227 if (PortP->HostP != HostP) {
235 if (!(PortP->PortState & PORT_ISOPEN)) {
243 ttyP = PortP->gs.port.tty;
248 rio_spin_lock(&PortP->portSem);
253 if (can_remove_receive(&PacketP, PortP))
254 RIOReceive(p, PortP);
261 if (!can_remove_receive(&PacketP, PortP) && (readw(&PortP->PhbP->handshake) == PHB_HANDSHAKE_SET)) {
267 writew(PHB_HANDSHAKE_SET | PHB_HANDSHAKE_RESET, &PortP->PhbP->handshake);
269 rio_spin_unlock(&PortP->portSem);
288 struct Port *PortP = p->RIOPortp[port];
296 if (!PortP->Mapped) {
305 if (PortP->HostP != HostP) {
313 if (!(PortP->PortState & PORT_ISOPEN)) {
321 rio_spin_lock(&PortP->portSem);
327 if (!can_add_transmit(&PacketP, PortP)) {
329 rio_spin_unlock(&PortP->portSem);
337 ttyP = PortP->gs.port.tty;
341 rio_spin_unlock(&PortP->portSem);
361 ** ++++ Extra! Extra! If PortP->WflushFlag is set, then we
382 if (PortP->MagicFlags) {
383 if (PortP->MagicFlags & MAGIC_REBOOT) {
396 PortP->InUse = NOT_INUSE;
398 rio_spin_unlock(&PortP->portSem);
399 if (RIOParam(PortP, RIOC_OPEN, ((PortP->Cor2Copy & (RIOC_COR2_RTSFLOW | RIOC_COR2_CTSFLOW)) == (RIOC_COR2_RTSFLOW | RIOC_COR2_CTSFLOW)) ? 1 : 0, DONT_SLEEP) == RIO_FAIL)
401 rio_spin_lock(&PortP->portSem);
402 PortP->MagicFlags &= ~MAGIC_REBOOT;
409 if (PortP->WflushFlag) {
412 if (PortP->InUse)
416 while (PortP->WflushFlag && can_add_transmit(&PacketP, PortP) && (PortP->InUse == NOT_INUSE)) {
428 p = PortP->HostPort % (u16) PORTS_PER_RTA;
434 if (PortP->SecondBlock)
449 writeb('0' + PortP->WflushFlag, &PacketP->data[9]);
462 if (!(PortP->State & RIO_DELETED)) {
463 add_transmit(PortP);
467 if (PortP->statsGather)
468 PortP->txchars += 2;
471 if (--(PortP->WflushFlag) == 0) {
472 PortP->MagicFlags &= ~MAGIC_FLUSH;
475 rio_dprintk(RIO_DEBUG_INTR, "Wflush count now stands at %d\n", PortP->WflushFlag);
477 if (PortP->MagicFlags & MORE_OUTPUT_EYGOR) {
478 if (PortP->MagicFlags & MAGIC_FLUSH) {
479 PortP->MagicFlags |= MORE_OUTPUT_EYGOR;
481 if (!can_add_transmit(&PacketP, PortP)) {
482 rio_spin_unlock(&PortP->portSem);
485 rio_spin_unlock(&PortP->portSem);
486 RIOTxEnable((char *) PortP);
487 rio_spin_lock(&PortP->portSem);
488 PortP->MagicFlags &= ~MORE_OUTPUT_EYGOR;
498 if (!can_add_transmit(&PacketP, PortP)) {
499 rio_spin_unlock(&PortP->portSem);
503 rio_spin_unlock(&PortP->portSem);
504 RIOTxEnable((char *) PortP);
512 static void RIOReceive(struct rio_info *p, struct Port *PortP)
544 TtyP = PortP->gs.port.tty;
550 if (PortP->State & RIO_THROTTLE_RX) {
555 if (PortP->State & RIO_DELETED) {
556 while (can_remove_receive(&PacketP, PortP)) {
557 remove_receive(PortP);
558 put_free_end(PortP->HostP, PacketP);
569 while (can_remove_receive(&PacketP, PortP)
589 remove_receive(PortP);
590 put_free_end(PortP->HostP, PacketP);
610 rio_dprintk(RIO_DEBUG_REC, "port %d: Copy %d bytes\n", PortP->PortNum, transCount);
616 ptr = (unsigned char __iomem *) PacketP->data + PortP->RxDataStart;
620 PortP->RxDataStart += transCount;
632 remove_receive(PortP);
633 put_free_end(PortP->HostP, PacketP);
634 PortP->RxDataStart = 0;
639 rio_dprintk(RIO_DEBUG_REC, "port %d: pushing tty flip buffer: %d total bytes copied.\n", PortP->PortNum, copied);