Lines Matching refs:sp

67 int CheckReadQueue(sp)		/* (CCBPtr sp) */
68 register CCBPtr sp;
77 dPrintf(D_M_ADSP, D_L_TRACE, ("CheckReadQueue: sp=0x%x\n", (unsigned)sp));
78 KERNEL_DEBUG(DBG_ADSP_READ, 0, sp, sp->rbuf_mb, sp->rpb, sp->delay);
79 trace_mbufs(D_M_ADSP_LOW, " bCQR m", sp->rbuf_mb);
81 while (sp->rData && (pb = sp->rpb)) { /* have data */
88 sp->rpb = pb->qLink;
94 completepb(sp, pb);
99 /* take the first packet off of sp->rbuf_mb or sp->crbuf_mb */
100 if ((mp = sp->rbuf_mb)) { /* Get header for oldest data */
102 sp->rbuf_mb = gbuf_next(mp);
105 } else if ((mp = sp->crbuf_mb)) {
107 sp->crbuf_mb = 0;
113 data onto the front of sp->rbuf_mb, otherwise sp->crbuf_mb. */
123 gbuf_next(tmp) = sp->rbuf_mb;
124 sp->rbuf_mb = tmp;
127 sp->crbuf_mb = tmp;
139 if ((sp->rbuf_mb == 0) &&
140 (sp->crbuf_mb == 0)) /* no more data blocks */
141 sp->rData = 0;
148 ((sp->state == sClosed) && (!sp->rData)) ) {
154 sp->rpb = pb->qLink; /* dequeue request */
169 KERNEL_DEBUG(DBG_ADSP_READ, 0x0C, pb, sp,
170 pb->u.ioParams.actCount, sp->delay);
171 completepb(sp, pb);
176 if ((pb = sp->rpb)) { /* if there is an outstanding request */
183 if (sp->state == sClosed) {
185 KERNEL_DEBUG(DBG_ADSP_READ, 0x0E, pb, sp, pb->ioc, 0);
189 sp->rpb = pb->qLink;
193 completepb(sp, pb);
195 pb = sp->rpb;
199 sp->rpb = pb->qLink;
204 KERNEL_DEBUG(DBG_ADSP_READ, 0x0F, pb, sp, pb->mp, 0);
210 pb->qLink = sp->rpb; /* requeue the duplicate at the head */
211 sp->rpb = pb;
218 KERNEL_DEBUG(DBG_ADSP_READ, 0x10, pb, sp, pb->mp, 0);
220 sp->crbuf_mb = tmp;
221 sp->rData = 1;
235 if (sp->rbufFull && (CalcRecvWdw(sp) > (sp->rbuflen >> 2))) {
236 sp->rbufFull = 0;
237 sp->sendDataAck = 1;
238 sp->callSend = 1;
241 KERNEL_DEBUG(DBG_ADSP_READ, 0x11, sp, 0, 0, 0);
242 trace_mbufs(D_M_ADSP_LOW, " eCQR m", sp->rbuf_mb);
253 * sp
261 int CheckAttn(sp, pb) /* (CCBPtr sp) */
262 register CCBPtr sp;
269 ("CheckAttn: sp=0x%x, pb=0x%x\n", (unsigned)sp, (unsigned)pb));
271 if ((mp = sp->attn_mb)) {
277 pb->u.attnParams.attnSize = sp->attnSize;
278 pb->u.attnParams.attnCode = sp->attnCode;
279 if (!sp->attnSize) {
283 sp->userFlags &= ~eAttention;
288 sp->attn_mb = 0;
309 * --> sp stream pointer
322 int adspRead(sp, pb) /* (DSPPBPtr pb) */
323 register CCBPtr sp;
329 ("adspRead: sp=0x%x, pb=0x%x\n", (unsigned)sp, (unsigned)pb));
331 KERNEL_DEBUG(DBG_ADSP_READ, 0x12, sp, pb, sp->state, sp->rData);
333 if (sp == 0) {
341 if (sp->state != sOpen && sp->state != sClosing && sp->state != sClosed) {
345 if (sp->rData && (sp->rpb == 0)) { /* if data, and no queue of pbs */
346 qAddToEnd((struct qlink **)&sp->rpb, (struct qlink *)pb); /* deliver data to user directly */
347 CheckReadQueue(sp);
348 } else if ((pb->u.ioParams.reqCount == 0) && (sp->rpb == 0)) {
360 qAddToEnd((struct qlink **)&sp->rpb, (struct qlink *)pb); /* and queue it for later */
367 if (sp->callSend) {
368 CheckSend(sp); /* If recv window opened, we might */
378 * --> sp stream pointer
388 int adspReadAttention(sp, pb) /* (DSPPBPtr pb) */
389 register CCBPtr sp;
393 ("adspReadAttention: sp=0x%x, pb=0x%x\n", (unsigned)sp, (unsigned)pb));
394 if (sp == 0) {
402 if (sp->state != sOpen && sp->state != sClosing && sp->state != sClosed) {
407 CheckAttn(sp, pb); /* Anything in the attention queue */
408 CheckReadQueue(sp); /* check to see if receive window has opened */
409 if (sp->callSend) {
410 CheckSend(sp); /* If recv window opened, we might */