• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.5.8/xnu-1228.15.4/bsd/netat/

Lines Matching refs:pb

61  * is data, a pb and the data are queued to the user.
70 register struct adspcmd *pb;
81 while (sp->rData && (pb = sp->rpb)) { /* have data */
83 (" pb=0x%p, gref=0x%p, ioc=0x%p, reqCount=%d (have data)\n",
84 pb, pb->gref, pb->ioc, pb->u.ioParams.reqCount));
85 KERNEL_DEBUG(DBG_ADSP_READ, 1, pb, pb->gref, pb->ioc, pb->u.ioParams.reqCount);
86 if (pb->u.ioParams.reqCount == 0) {
87 pb->ioResult = 0;
88 sp->rpb = pb->qLink;
89 if (pb->ioc) {
90 KERNEL_DEBUG(DBG_ADSP_READ, 2, pb, pb->gref, pb->ioc, 0);
91 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref);
93 KERNEL_DEBUG(DBG_ADSP_READ, 3, pb, pb->gref, 0, 0);
94 completepb(sp, pb);
101 KERNEL_DEBUG(DBG_ADSP_READ, 4, pb, mp, gbuf_msgsize(mp), gbuf_next(mp));
106 KERNEL_DEBUG(DBG_ADSP_READ, 5, pb, mp, gbuf_msgsize(mp), gbuf_next(mp));
112 the end of pb->mp. If eom is set, put the remainder of the
115 if (cnt > (unsigned short)(pb->u.ioParams.reqCount - pb->u.ioParams.actCount)) {
116 cnt = pb->u.ioParams.reqCount - pb->u.ioParams.actCount;
130 pb->u.ioParams.actCount += cnt;
131 gbuf_linkb(pb->mp, mp);
134 pb->u.ioParams.eom = eom;
147 if (eom || (pb->u.ioParams.actCount >= pb->u.ioParams.reqCount) ||
153 pb->ioResult = 0;
154 sp->rpb = pb->qLink; /* dequeue request */
155 if (pb->ioc) { /* data to be delivered at the time of the */
156 mp = gbuf_cont(pb->mp); /* ioctl call */
157 gbuf_cont(pb->mp) = 0;
158 gref = (gref_t *)pb->gref;
159 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref);
160 dPrintf(D_M_ADSP, D_L_TRACE, (" (pb->ioc) mp=%p\n", mp));
161 KERNEL_DEBUG(DBG_ADSP_READ, 0x0A, pb, mp,
165 (" (data) size req=%d\n", pb->u.ioParams.actCount));
166 KERNEL_DEBUG(DBG_ADSP_READ, 0x0B, pb, pb->ioc,
167 pb->u.ioParams.reqCount, pb->u.ioParams.actCount);
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 */
178 (" pb=0x%p, ioc=0x%p, reqCount=%d (no more data)\n",
179 pb, pb->ioc, pb->u.ioParams.reqCount));
180 KERNEL_DEBUG(DBG_ADSP_READ, 0x0D, pb, pb->ioc,
181 pb->u.ioParams.reqCount, pb->u.ioParams.actCount);
184 while (pb) {
185 KERNEL_DEBUG(DBG_ADSP_READ, 0x0E, pb, sp, pb->ioc, 0);
186 pb->ioResult = 0;
187 pb->u.ioParams.actCount = 0;
188 pb->u.ioParams.eom = 0;
189 sp->rpb = pb->qLink;
190 if (pb->ioc) {
191 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref);
193 completepb(sp, pb);
195 pb = sp->rpb;
197 } else if (pb->ioc) { /* if request not complete and this
199 sp->rpb = pb->qLink;
200 pb->ioResult = 1;
201 tmp = gbuf_cont(pb->mp); /* detatch perhaps delayed data */
202 gbuf_cont(pb->mp) = 0;
203 if ((mp = gbuf_copym(pb->mp))) { /* otherwise, duplicate user request */
204 KERNEL_DEBUG(DBG_ADSP_READ, 0x0F, pb, sp, pb->mp, 0);
205 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref); /* release user */
206 pb = (struct adspcmd *)gbuf_rptr(mp); /* get new parameter block */
207 pb->ioc = 0;
208 pb->mp = mp;
209 gbuf_cont(pb->mp) = tmp; /* reattach data */
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);
223 pb->ioResult = errDSPQueueSize;
224 adspioc_ack(ENOBUFS, (gbuf_t *)pb->ioc, pb->gref);
250 * in the passed in pb.
254 * pb
261 int CheckAttn(sp, pb) /* (CCBPtr sp) */
263 register struct adspcmd *pb;
269 ("CheckAttn: sp=0x%x, pb=0x%x\n", (unsigned)sp, (unsigned)pb));
276 gref = (gref_t *)pb->gref;
277 pb->u.attnParams.attnSize = sp->attnSize;
278 pb->u.attnParams.attnCode = sp->attnCode;
289 pb->ioResult = 0;
294 pb->u.attnParams.attnSize = 0;
295 pb->u.attnParams.attnCode = 0;
296 pb->ioResult = 1; /* not done */
298 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref);
310 * --> pb user request parameter block
322 int adspRead(sp, pb) /* (DSPPBPtr pb) */
324 register struct adspcmd *pb;
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);
334 pb->ioResult = errRefNum;
342 pb->ioResult = errState;
346 qAddToEnd((struct qlink **)&sp->rpb, (struct qlink *)pb); /* deliver data to user directly */
348 } else if ((pb->u.ioParams.reqCount == 0) && (sp->rpb == 0)) {
350 pb->ioResult = 0;
351 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref);
354 pb->ioResult = 1;
355 if ((mp = gbuf_copym(pb->mp))) { /* otherwise, duplicate user request */
356 adspioc_ack(0, (gbuf_t *)pb->ioc, pb->gref); /* release user */
357 pb = (struct adspcmd *)gbuf_rptr(mp); /* get new parameter block */
358 pb->ioc = 0;
359 pb->mp = mp;
360 qAddToEnd((struct qlink **)&sp->rpb, (struct qlink *)pb); /* and queue it for later */
362 pb->ioResult = errDSPQueueSize;
379 * --> pb user request parameter block
388 int adspReadAttention(sp, pb) /* (DSPPBPtr pb) */
390 register struct adspcmd *pb;
393 ("adspReadAttention: sp=0x%x, pb=0x%x\n", (unsigned)sp, (unsigned)pb));
395 pb->ioResult = errRefNum;
403 pb->ioResult = errState;
407 CheckAttn(sp, pb); /* Anything in the attention queue */