Lines Matching refs:sp
78 static void GleanSession(sp) /* (CCBPtr sp) */
79 CCBPtr sp;
81 if (sp->openState == O_STATE_OPEN) {
83 RemoveTimerElem(&adspGlobal.slowTimers, &sp->ProbeTimer);
84 InsertTimerElem(&adspGlobal.slowTimers, &sp->ProbeTimer,
85 sp->probeInterval);
86 sp->probeCntr = 4;
406 MatchStream(sp, m) /* (CCBPtr sp, MATCHPtr m) */
407 CCBPtr sp;
413 if (sp->openState < O_STATE_LISTEN ||
414 sp->openState > O_STATE_OPEN)
418 m->t = &tbl[sp->openState - O_STATE_LISTEN + m->idx];
426 if (sp->localSocket != m->socket)
433 if (sp->remoteAddress.a.node != addr.a.node)
435 if (sp->remoteAddress.a.socket != addr.a.socket)
437 if (sp->remoteAddress.a.net && addr.a.net &&
438 (sp->remoteAddress.a.net != addr.a.net))
444 if ((m->srcCID == sp->locCID) &&
461 if (sp->locCID != m->dstCID)
466 if (sp->remCID != m->srcCID)
482 if ((opb = sp->opb)) /* There should be a param block... */
510 static boolean MatchListener(sp, m) /* (CCBPtr sp, MATCHPtr m) */
511 CCBPtr sp;
515 if ((sp->state == (word)sListening) && /* This CCB is a listener */
516 (sp->localSocket == m->socket)) /* on the right socket */
547 CCBPtr sp;
595 if ((sp = (CCBPtr)qfind_m((CCB *)AT_ADSP_STREAMS, &m, (ProcPtr)MatchStream)) == 0)
606 if ((sp = (CCBPtr)qfind_m((CCB *)AT_ADSP_STREAMS, &m,
610 p = (struct adspcmd *)&sp->opb;
630 completepb(sp, n); /* complete copy of request */
642 *spPtr = sp; /* Save ptr to stream we just found */
644 sp->openState = m.t->openState; /* Move to next state (may be same) */
645 sp->state = m.t->state; /* Move to next state (may be same) */
648 sp->firstRtmtSeq = sp->sendSeq = UAL_VALUE_NTOH(f->pktNextRecvSeq);
649 sp->sendWdwSeq = UAL_VALUE_NTOH(f->pktNextRecvSeq) + UAS_VALUE_NTOH(f->pktRecvWdw) - 1;
650 sp->attnSendSeq = UAL_VALUE_NTOH(op->pktAttnRecvSeq); /* on even boundry */
653 sp->remCID = UAS_VALUE_NTOH(f->CID); /* Save Source CID as RemCID */
654 UAS_UAS(sp->of.dstCID, f->CID); /* Save CID in open ctl packet */
656 sp->remoteAddress = addr; /* Save his address */
661 DoClose(sp, errOpenDenied, -1);
667 RemoveTimerElem(&adspGlobal.fastTimers, &sp->RetryTimer);
668 sp->sendSeq = sp->firstRtmtSeq;
669 sp->pktSendCnt = 0;
670 sp->waitingAck = 0;
671 sp->callSend = 1;
675 sp->sendCtl |= m.t->send;
676 sp->callSend = 1;
680 RemoveTimerElem(&adspGlobal.slowTimers, &sp->ProbeTimer);
682 if ((pb = sp->opb)) {
683 sp->opb = 0;
684 pb->u.openParams.localCID = sp->locCID;
685 pb->u.openParams.remoteCID = sp->remCID;
687 *((at_inet_t *)&sp->remoteAddress);
688 pb->u.openParams.sendSeq = sp->sendSeq;
689 pb->u.openParams.sendWindow = sp->sendWdwSeq - sp->sendSeq;
690 pb->u.openParams.attnSendSeq = sp->attnSendSeq;
692 completepb(sp, pb); /* complete(pb, 0); */
696 InsertTimerElem(&adspGlobal.slowTimers, &sp->ProbeTimer,
697 sp->probeInterval);
734 CCBPtr sp;
736 sp = 0; /* No stream */
754 if ((sp = (CCBPtr)FindSender(f, a)))
755 GleanSession(sp);
758 if (sp && RXAttention(sp, mp, f, len))
767 if (sp)
768 CheckRecvSeq(sp, f);
775 if (RXConnection(gref, &sp, f, len, a, dsoc))
780 if (sp) {
782 CheckRecvSeq(sp, f);
783 RxClose(sp);
784 sp = 0;
791 if (sp && (CheckRecvSeq(sp, f), RXFReset(sp, f)))
796 if (sp && (CheckRecvSeq(sp, f), RXFResetAck(sp, f)))
801 if (sp) {
803 CheckRecvSeq(sp, f);
804 RemoveTimerElem(&adspGlobal.fastTimers, &sp->RetryTimer);
805 sp->sendSeq = sp->firstRtmtSeq;
806 sp->pktSendCnt = 0;
807 sp->waitingAck = 0;
808 sp->callSend = 1;
819 if ((sp == 0) || RXData(sp, mp, f, len))
829 if (sp && sp->callSend) /* If we have a stream & we need to send */
830 CheckSend(sp);