MCPcopy Create free account
hub / github.com/apache/nuttx / sim_reqcomplete

Function sim_reqcomplete

arch/sim/src/sim/sim_usbdev.c:347–370  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

345 ****************************************************************************/
346
347static void sim_reqcomplete(struct sim_ep_s *privep, int16_t result)
348{
349 struct sim_req_s *privreq;
350 irqstate_t flags;
351
352 /* Remove the completed request at the head of the endpoint request list */
353
354 flags = enter_critical_section();
355 privreq = sim_rqdequeue(&privep->reqq);
356 leave_critical_section(flags);
357
358 if (privreq)
359 {
360 /* Save the result in the request structure */
361
362 privreq->req.result = result;
363
364 privep->epstate = SIM_EPSTATE_IDLE;
365
366 /* Callback to the request completion handler */
367
368 privreq->req.callback(&privep->ep, &privreq->req);
369 }
370}
371
372/****************************************************************************
373 * Name: sim_reqwrite

Callers 2

sim_reqwriteFunction · 0.85
sim_usbdev_epreadFunction · 0.85

Calls 3

enter_critical_sectionFunction · 0.85
sim_rqdequeueFunction · 0.85
leave_critical_sectionFunction · 0.85

Tested by

no test coverage detected