/* * Context: softirq or process */ void oz_usb_request_heartbeat(void *hpd) { struct oz_usb_ctx *usb_ctx = (struct oz_usb_ctx *)hpd; if (usb_ctx && usb_ctx->pd) oz_pd_request_heartbeat(usb_ctx->pd); }
/*------------------------------------------------------------------------------ * Context: softirq */ void oz_pd_heartbeat(struct oz_pd *pd, u16 apps) { struct oz_app_if *ai; int more = 0; for (ai = g_app_if; ai < &g_app_if[OZ_APPID_MAX]; ai++) { if (ai->heartbeat && (apps & (1<<ai->app_id))) { if (ai->heartbeat(pd)) more = 1; } } if (more) oz_pd_request_heartbeat(pd); if (pd->mode & OZ_F_ISOC_ANYTIME) { int count = 8; while (count-- && (oz_send_isoc_frame(pd) >= 0)) ; } }